-4

For this program, I have to read full names in from a .txt file and capitalize the first letter of the first name and the first letter of the surname.

Ex. john brown ----> John Brown

The program must also concatenate the results so that

John Brown -----> JNBN

How would I go about doing this? I have no clue how to do this. I'm brand new to Java.

Wyatt Bush
  • 5
  • 1
  • 2
  • 5
  • 1
    where is your sample input? Is it one name per line? Have you tried this yourself? If so, where are you stuck? – austin wernli Feb 06 '15 at 16:12
  • 3
    What did you try? Also what is the rule for John Brown -----> JNBN (first/last ?) –  Feb 06 '15 at 16:12
  • 2
    possible duplicate of [Capitalize First Char of Each Word in a String Java](http://stackoverflow.com/questions/1892765/capitalize-first-char-of-each-word-in-a-string-java) – Ascalonian Feb 06 '15 at 16:14
  • Apache Commons is to the rescue on this again. Check out the duplicate link – Ascalonian Feb 06 '15 at 16:16

1 Answers1

3

just use the toUpperCase() command