Hetal,
In addition to the other comments.
There are three Split functions in .NET:
Use Microsoft.VisualBasic.Strings.Split if you need to split a string based
on a specific word (string). It is the Split function from VB6.
Use System.String.Split if you need to split a string based on a collection
of specific characters. Each individual character is its own delimiter.
Use System.Text.RegularExpressions.RegEx.Split to split based
on matching patterns.
By referencing the Microsoft.VisualBasic assembly in C# you can use the
Strings.Split function to split a string based on a word.
Something like:
string str = "one||two||three";
string [] fields = Strings.Split(str, "||", -1,
CompareMethod.Binary);
Hope this helps
Jay
"Hetal Shah" <sh**@jnpr.net> wrote in message
news:uM*************@TK2MSFTNGP11.phx.gbl... It is a C# code.
I have a string like, one||two||three
I want to split it into one, two and three.
string str = "one||two||three";
string[] myStrs = str.Split("||");
This code does not work.
How can I do it?
Yhanks
Hetal