Solved

Split a name

Posted on 2009-07-10
1
180 Views
Last Modified: 2012-05-07
I have a name: lets say
Johan Andersen

I want to split this into first name and second name.
How do I do it?

I guess I have to search for the space.....but how?
0
Comment
Question by:Mickeys
1 Comment
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
ID: 24821472
string [] nameParts = "Johan Andersen".Split(' ');

string first = nameParts[0];
string second= nameParts[1];
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question