|
-
Dec 5th, 2004, 11:16 PM
#1
Thread Starter
Frenzied Member
Replace enter with space [RESOLVED]
Hi all,
I have a multiline textbox in which user enters some text and then I add those values in a combobox. Before adding to combo, I need to convert "Enter" key press with a single space. How can I convert "Enter" with a single space.
Thanks.
Last edited by usamaalam; Dec 6th, 2004 at 11:51 PM.
-
Dec 6th, 2004, 03:03 AM
#2
Junior Member
Re: Replace enter with space
Search for \r\n (<enter> - new line) and replace that with a space.
-
Dec 6th, 2004, 03:58 AM
#3
Hyperactive Member
Re: Replace enter with space
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Dec 6th, 2004, 09:53 PM
#4
PowerPoster
Re: Replace enter with space
That code works, but this might be better for future proofing:
Code:
string text = textBox5.Text;
text = text.Replace(System.Environment.NewLine," ");
textBox5.Text = text;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|