View Single Post
Old 11-16-2012, 01:42 PM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,645
Thanks: 4
Thanked 2,450 Times in 2,419 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Why not just store them in a string array? Use a string builder if you want when you're ready to combine them.
Mm, looks like you may just want to ask for the one name though yeah? in which case you already have a string for the entirety. There's a dozen ways to do this both with and without the string builder, but most of it still stands. If you work directly on the string input instead of worrying about a stringbuilder, you can use split on a regex to give you a string array, or you can use the indexOf for the spaces and substring to pull it apart and separate the strings.
Stringbuilder will work pretty much the same way, target where the space is with the .indexOf(" ") check, and then use delete/append, substring or replace to just do parts of the string.
Fou-Lu is offline   Reply With Quote