//**********************************
StringTokenizer st = new StringTokenizer(src1,"");
//If an empty delimiter is given, automatically uses " " (space).
while(st.HasMoreTokens())
{
Console.WriteLine(st.NextToken());
}
string src2 = "Hello World!";
st.NewSource(src2);
while(st.HasMoreTokens())
{
Console.WriteLine(st.NextToken());
}
//**********************************
The output would be:
The
fat
cat
walked
on
the
wall.
Hello
World!
siva sankareditedPosted Jul 11, 2006, 7:53 AMEdited Nov 23, 2006, 8:37 AM
Hello sir, I have a string which contains a delimeter ':@:'. I want to split that string with the given delimeter because i can't pass more than one char.(or) how to use StringTokenizer? can we pass delimeter as more than one character? Thanks & Regards Siva Sankar D