0
c#
int a =0; string name=textBox1.Text.Trim(); char[] ch= name.ToCharArray(); a=ch.Length; for(int i =ch.Length-1; i>=0;i--) { if(a %2 ==0) { richTextBox1.Text += ch[i].ToString(); richTextBox1.ForeColor= Color.Red; } else { richTextBox1.Text += ch[i].ToString(); richTextBox1.ForeColor= Color.Black; } But when i put Letter like this "book" it is go to( first condition) but "Bo ok" it is not go to (first condition ) why like this ? I want to cut space.
3 Answers
+ 2
string.replace(" ","");
The first " " is to search for all the spaces in a string and the second "" is to replace it with nothing.
0
Can you give Example please sir?