|
-
March 1st, 2006, 03:17 PM
#1
how do u switch names places? i.e. typing in first/last name, and display backwards
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!
Last edited by adamm104; March 1st, 2006 at 03:33 PM.
-
March 1st, 2006, 04:02 PM
#2
Re: can u check this code please? i can't get it to work!
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....
Last edited by gigemboy; March 1st, 2006 at 04:06 PM.
-
March 2nd, 2006, 08:09 AM
#3
Re: can u check this code please? i can't get it to work!
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|