Example on Split String using C#
C# string Split function returns an array of String containing the substrings delimited by the given System.Char array.
public class StringSplitExample
{
public static void Main()
{
string str = null;
string[] strArr = null;
int count = 0;
str
= "Dot Net Masty";
char[] splitchar = { ' ' };
strArr
= str.Split(splitchar);
for (count = 0; count <= strArr.Length - 1;
count++)
{
Console.WriteLine(strArr[count]);
}
Console.ReadLine();
}
}
No comments:
Post a Comment