I am trying to split a string into two arrays.
The first array has data at the beginning of the string which is split by the \t
(tab) character, and the remainder somes after the first newline character (\n
).
I tried this, thinking that's what I wanted:
string[] pqRecords = pqRequests.ToString().Split('\n');
I also tried this:
internal static readonly string segment = Environment.NewLine + "\t";
string[] pqRecords = pqRequests.ToString().Split(segment);
unfortunately the Split
method will only take a single character.
I know there are vbcr in my pqRequests string variable because when I mouse over it and look at the text visualize there is the first line with tabs, everything else is on it's own line.
This data is taken from a txt file, and in the file, when opened in Notepad++, I can see the CR
characters.
Is there an alternative constant in c# I should use for these CR characters?