Returns a String array containing the substrings in this instance that are delimited by elements of a specified Char array.

The return value is not an independent copy of this instance; it is simply another view of the same data. Use the Copy or CopyTo method to create a separate String object with the same value as this instance.

 

/*
* Created by SharpDevelop.
* User: MANASXP
* Date: 1/22/2007
* Time: 4:40 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
//string_split.cs
namespace ex_stringsplit
{
public class string_split
{
public void split_to_char(string ss )
{
string words = ss;
string [] split = words.Split(new Char [] {' ', ',', '.', ':'});
foreach (string s in split) {
if (s.Trim() != "")
Console.WriteLine(s);
}//end for loop
}//end method string_split
}//end class
class Test
{
static void Main() {
Console.Write("Enter a senctence : ");
string str = Console.ReadLine();
string_split ssp = new string_split();
ssp.split_to_char(str);
}
}//end class test
}//end name space