Retrieving a single value from a String array
A while back I posted a topic about if there was a way to take a simple 2 word input and turn it into a name by capitalising the first letter, and making sure every other letter was lower case. After a lot of poking I managed to get something that not only does this; but trims space and all the other wonderful things the String class can do! It works, no problem, can take anything from "nAME sURNAME" to "nAmE SuRnAmE " and will always return "Name Surname".
I then went on to stage 2, I was hoping to be able to construct an array in this method, so that it would return;
This obviously doesn't include the constructors to assemble the name as I didn't think it was relevant (as it works). I end up with the String name that contains
finalname = Name Surname
finalname = Name
finalname = Surname
and my question is; Is there a way of calling any individual value as a string and printing it to the console? Is it possible to call name and get Name, then later name and get Surname.
[Name Surname, Name, Surname]
I figure it isn't possible to just call them, and so far the only way of printing it at all is the Arrays.toString method which just prints all the contents.
Thanks for your help,