473,800 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to remove CR LF from a multiline text box

Hi,

How do you remove the CRLF from a multiline textbox entry? Does anybody
have an example?

Thanks,
MO

Nov 17 '05 #1
4 16681
<le******@yahoo .com> wrote:
How do you remove the CRLF from a multiline
textbox entry? Does anybody have an example?


myTextBox.Text = myTextBox.Text. Replace("\r\n", "");

P.
Nov 17 '05 #2
Hi,

IMO a better solution is using Environment.New Line instead of hardcoding
"\r\n"

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Paul E Collins" <fi************ ******@CL4.org> wrote in message
news:di******** **@nwrdmz01.dmz .ncs.ea.ibs-infra.bt.com...
<le******@yahoo .com> wrote:
How do you remove the CRLF from a multiline
textbox entry? Does anybody have an example?


myTextBox.Text = myTextBox.Text. Replace("\r\n", "");

P.

Nov 17 '05 #3
<"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.mach in AT
dot.state.fl.us >> wrote:
IMO a better solution is using Environment.New Line instead of hardcoding
"\r\n"


That partly depends on what other platforms use for the line separator
within textboxes. There's nothing to say it's the same as the natural
line separator for the platform. For instance, I don't know what Mono
uses as the line separator in its WinForms implementation - how sure
are you that it's "\n" instead of "\r\n"?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4
Hi,

You are right, even in a web environment the client may has a different
separator than the server.

cheers,
"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
<"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.mach in AT
dot.state.fl.us >> wrote:
IMO a better solution is using Environment.New Line instead of hardcoding
"\r\n"


That partly depends on what other platforms use for the line separator
within textboxes. There's nothing to say it's the same as the natural
line separator for the platform. For instance, I don't know what Mono
uses as the line separator in its WinForms implementation - how sure
are you that it's "\n" instead of "\r\n"?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1791
by: raj | last post by:
I have multiline-text box in my C# application. User enter text into the multiline-text box, and without completing the whole line, user press Enter Key and go to the next line, by leaving the '\n'(new line character) in the string. I use this text to write to a database field and then write that field to an excel file. The string is not writing to a single line as it has the carriage return ('\n), wraps the text into the next line in...
0
1136
by: raj | last post by:
I have multiline-text box in my C# application. User enter text into the multiline-text box, and without completing the whole line, user press Enter Key and go to the next line, by leaving the '\n'(new line character) in the string. I use this text to write to a database field and then write that field to an excel file. The string is not writing to a single line as it has the carriage return ('\n), wraps the text into the next line in...
6
6187
by: Iver Erling Årva | last post by:
I am looking for a way to let the users copy e.g. a multi-line address from a textfile and paste it into a webpage where there is one input field for each address line in such a way that not only the first line is pasted, but instead the program automatically jumps to the next field and put line 2 in there and so on. Can this be done? I tried with onkeydown to check for event.keyCode == 13, but it doesn't seem to work with paste. Brgds
2
1515
by: gjtired | last post by:
Hi, I'm not sure the best way to do something and I hope someone can help me. I'm developing a web application that a user enters test questions in. I store the questions in a database. When a person takes the test I need to be able to display the questions. I can use a multiline text box but I want the user to see the entire question and not have to use the scroll bars. I also don't want the scroll bars visible if they are not used. I...
1
4138
by: Michael Tanner | last post by:
I have a multiline text box. I would like some of the text to be one font color and other text another font color. Is this possible with a multiline text box?
2
4611
by: Chris | last post by:
Hi We are using style sheets to set the font of our labels and text boxes. This has been working great until we required a text box with a textmode of Multiline. The control picks up the correct font/size until the text mode is changed from single line to multiline. We're currently using the H1, H2, H3 and Body tags for the page.
1
6724
by: Tracey | last post by:
Hi, there My application requires to display multiline text in the cell of datagrid. I set the preferredheight of datagrid's tablsstyle, however, it is fixed. For text longer than that, the rest of text is cut missing. Can someone tell me how to do that? thanks.
3
2327
by: Owen Richardson | last post by:
I have read several posts regarding formatting multiline text for rendering becuase vbCrLf needs to be converted to <br/tags, and i need to do the same. My question is the best way to achieve this - One of my pages is using a detailview control on a Description datafield; what would be the best way for me to format the Description field before its rendered? Regards Owen
6
3006
by: dawnerd | last post by:
Hello everyone. I have a question, or problem if you will, that I'm sure someone knows the answer to. I have a database that stores information on a given user. The information is stored in a serialized array. This works flawlessly when using only single line text. When I tried to store multiline text, the problem arose. When the serialized data is deserialized, the array breaks. Any suggestions?
2
9401
by: King | last post by:
Is there any other way to define multiline text in a XML file: <Help><!]> </Help>
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10251
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.