i can't figure this code out, supposed to type in a name like George Washington, and have it appear in a label, Washington, George
it has to have the comma and a space between comma and first name, thanks!
Printable View
i can't figure this code out, supposed to type in a name like George Washington, and have it appear in a label, Washington, George
it has to have the comma and a space between comma and first name, thanks!
Just a simple exercise in string manipulation....
One way is to just split the string on the Space character, into an array of strings. Then for the output, concatenate the 1 index of the array (lastname) with a comma and a space, then the 0 index of the array (first name)....
Another way is to just use .IndexOf on the space character, to get the position, then use that and .SubString in order to get the two parts of the string, then switch them seperated with a command and a space when you build the output string....
Here's a list of all String Manipulation functions, they will come in very handy someday!
http://msdn2.microsoft.com/en-us/library/e3s99sd8.aspx
PS: Please edit your thread title to something more descriptive :thumb: