I have a string in C# that look with pattern like this:
string Str = "!!DATA!!First!!Data!!Second!!DATA!!";
How can I split the string into array of string that contains that parts between the !!DATA!! parts?
I have a string in C# that look with pattern like this:
string Str = "!!DATA!!First!!Data!!Second!!DATA!!";
How can I split the string into array of string that contains that parts between the !!DATA!! parts?
it seems that you want a case insensitive !!DATA!! pattern the best solution for this is to use Regex
string[] data = Regex.Split(Str , "!!DATA!!",RegexOptions.IgnoreCase);
Did you do any research? http://msdn.microsoft.com/en-us/library/tabh47cf.aspx
string[] data = Str.Split( new string[]{"!!DATA!!"}, StringSplitOptions.RemoveEmptyEntries )
or maybe you want
string[] data = Str.Split( new string[]{"!!DATA!!","!!Data!!"}, StringSplitOptions.RemoveEmptyEntries );
string[] data = Str.Split(new string[] { "!!Data!!", "!!DATA!!" }, StringSplitOptions.RemoveEmptyEntries);
string[] data = yourString.Split(new string[] {"!!DATA!!"}, StringSplitOptions.RemoveEmptyEntries)
Check MSDN for further info.