Split string with space in CSharp
Description
The following code shows how to split string with space.
Example
// ww w. ja v a 2 s .c o m
using System;
using System.Text;
class SplitStringApp
{
static void Main(string[] args)
{
string s = "Once Upon A Time In America";
char[] seps = new char[]{' '};
foreach (string ss in s.Split(seps))
Console.WriteLine(ss);
}
}
The code above generates the following result.