You can safely use any character you like as a separator if you avoid the string so that you know that it does not contain that character.
Let, for example, select the character "a" as a separator. (I intentionally chose a regular character to show that any character can be used.)
Use the b character as an escape code. We replace any occurrence of "a" with "b1" and any occurrence of "b" in "b2":
private static string Escape(string s) { return s.Replace("b", "b2").Replace("a", "b1"); }
Now the line does not contain the characters 'a', so you can put several of these lines together:
string msg = Escape("banana") + "a" + Escape("aardvark") + "a" + Escape("bark");
The line now looks like this:
b2b1nb1nb1ab1b1rdvb1rkab2b1rk
Now you can split the string into "a" and get the individual parts:
b2b1nb1nb1 b1b1rdvb1rk b2b1rk
To decode the parts you replace back:
private static string Unescape(string s) { return s.Replace("b1", "a").Replace("b2", "b"); }
So, line separation and unencoding parts are done as follows:
string[] parts = msg.split('a'); for (int i = 0; i < parts.length; i++) { parts[i] = Unescape(parts[i]); }
Or using LINQ:
string[] parts = msg.Split('a').Select<string,string>(Unescape).ToArray();
If you choose a less general character as a separator, there are, of course, fewer cases that will be escaped. The fact is that this method ensures that the character is safe to use as a delimiter without any assumptions about what characters exist in the data that you want to put in the string.