Code Snippet posted by:
Kapildalke | Posted on: 5/26/2012 | Category:
C# Codes | Views: 422 | Status:
[Member] |
Points: 40
|
Alert Moderator
As you know that we have split function for split based on a particular character
Like
string str="This is very good string and every | bode can use it"
//string strPhrase = child.Phrase.Split('|');
Then it will give two values.
But suppose I have string like this
string str="This is very good string and every || bode can use it"
Now in this happened we will get three string's because we can not split this string based on || this .
for multiple charcter split you need to use this type of method
string str="This is very good string and every bode can use it"
string[] strPhrase = str.Split(new string[1] { "{every}" },StringSplitOptions.None);
string str1= strPhrase[0];
if this is not working then use this one
string[] res = str.Split(new string[] { "every" }, StringSplitOptions.None);
string str1 = res[1];
Now in this time we will retrieve two string after split based on "every".
Found interesting? Add this to: