Solved

Split a name

Posted on 2009-07-10
1
179 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

832 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