Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting lastname from fullname

Status
Not open for further replies.

yonelay

Programmer
Joined
Jan 17, 2007
Messages
10
Location
US
Hi,

This may be a silly question, but how can I get lastname out from lastname, firstname format? I got firstname with LastIndexOf(",")+1.
 
LastName = Fullname.remove(Fullname.LastIndex(","));
 
string[] names = "lastname, firstname".Split(", ");

Console.WriteLine("FirstName : " + names[1]);
Console.WriteLine("LastName : " + names[0]);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top