I have a string like this:
Washington
Madrid
Delhi
London
And I want to change it to:
Washington Madrid Delhi London
Replacing the newline characters with space characters.
This is what I tried:
private void button1_Click(object sender, EventArgs e)
{
//string of cities is recieved from a rich textbox
String cities;
cities = RichTextBox1.Text;
cities = cities.Replace(System.Environment.NewLine, " ");
RichTextBox1.Clear();
RichTextBox1.AppendText(cities);
}