Using Xml Deserilization I am getting value back from xml file and store the values to appropriate controls.
I have an array of email addresses.I am assigning it to textbox as follows.
textEmailAddress=string.Join("\n", emp.Emails);
( During serilization i split those addresses using : textEmailAddress.Text.Split(new[] { '\n', ',' });
)
The textBox "textEmailAddress" is getting filled up with email addresses with 'new line' symbols.
I applied
textEmailAddress.Text
= textEmailAddress.Text.Replace(Environment.NewLine, string.Empty);
but i am unable to remove the entire newline characters.
Best Answer
Environment.NewLine
depends on the environment. On Windows it is the string"\r\n"
(carriage return, line feed). To matchyou will have to do
instead of using
Environment.NewLine
.