// Split a string with a character:
string str = "I learn C#";
string wordCount = str.Split(' ').Length.ToString();
MessageBox.Show("There are " +wordCount+ " words in that sentence");
string[] sep = new string[] {"-|-"}; // Three-character separator
// Values are separated with our three characters:
string data = "223-|-19-|-57-|-TestFile.txt";
// Extract individual settings from our array:
string[] settings = data.Split(sep, StringSplitOptions.None);
Note: "StringSplitOptions.None" instructs .NET to include empty string elements in returned value.
string[] settings = data.Split(new string[] {"-|-"}, StringSplitOptions.None);