It might help you,
namespace StringSplitTest
{
using System.Text.RegularExpressions;
class Program
{
static void Main(string[] args)
{
var splittedData = SplitData("I!am!a!string", new[] { "!" });
var splittedDataUsingRegex = SplitDataUsingRegularExpression("I!am!a!string", "!");
}
public static string[] SplitData(string dataToSplit, string[] separator)
{
return dataToSplit.Split(separator, System.StringSplitOptions.None);
}
public static string[] SplitDataUsingRegularExpression(string dataToSplit, string pattern)
{
return Regex.Split(dataToSplit, pattern);
}
}
}
:)