How to convert a string to a string
Posted on 2006-05-16
I have a stream with standand ascii CR/LF delimiting new lines. I would like to insert this into a string array. This is my current method utilising the formatting of a richtextbox but I would like to be able to achieve this without the overhead of the richtextbox control - is there a better way than doing a loop and adding each line individually to the array?
byte b = (byte)reader.GetValue(0);
RichTextBox rtb = new RichTextBox();
rtb.Text = System.Text.Encoding.ASCII.GetString(b,0,b.Length);
Macro = rtb.Lines;
Would appreciate your thoughts!