Reputation: 31
Prefered output -
Hi
Hello
U There...
Current output -
Hi Hello U there...
Using replace method with <br/>
tags works only for new line. However I need to retain the space between U and There.
Can anyone provide a solution to this?
Upvotes: 3
Views: 1240
Reputation: 19
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
string sos = "";
if (TextBox1.Text == sos)
{
TextBox1.Text = "00";
}
char opo = TextBox1.Text[0];
char opo1 = TextBox1.Text[1];
Label1.Text = (opo + " " + opo1);
}
input to texbox text = 23 autput to Label = 2 3
Upvotes: 0
Reputation: 176956
Adding to @Jon Skeet answer replace space by   using regular expression.
string s1 = "He saw a cute\tdog.";
Regex r = new Regex(@"\s+");
string s3 = r.Replace(s1, " ");
Upvotes: 1
Reputation: 1845
In html just add null eg:
<html>
<body>
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup >// get a space between
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Upvotes: 0