how to store text without space(using textbox) in sql database??
-
hi guys,. i would like to store text(using textbox) in my database.. but i have lot of space between first and last name.. for eg: if i put 10 char space b/w first and last means i should print text with only single space.. question:- textbox1=syed hussain answer:- textbox2=syed hussain if anybody know the answer pls reply me!! thanks.
-
hi guys,. i would like to store text(using textbox) in my database.. but i have lot of space between first and last name.. for eg: if i put 10 char space b/w first and last means i should print text with only single space.. question:- textbox1=syed hussain answer:- textbox2=syed hussain if anybody know the answer pls reply me!! thanks.
try the following code.... its written in c# string str = "Syed Hussain"; // our initial string str = str.Trim(); // remove any spaces from start and end of the string int index = str.IndexOf(" "); // get the index of the first space str = str.Replace(" ",""); // remove all spaces str = str.Insert(index, " "); // insert single space at the position of INDEX Label1.Text = str; // now you get the string with single space.
“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”