473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

replacing CR with <BR>

I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR> one by
one?
Nov 18 '05 #1
5 2626
Jos
Saber wrote:
I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR>
one by one?


You didn't say which language you use.

This is for VB:
Dim Text2 As String = TextBox1.Text.Replace(vbCRLF,"<BR>")

--

Jos
Nov 18 '05 #2
On Fri, 30 Jul 2004 20:35:17 +0430, "Saber"
<saber[--AT--]maghalat.com> wrote:
I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR> one by
one?


the string class has replace functions.

-Adam

Nov 18 '05 #3
something wrong with using the Replace function?

newstring = txtMultiline.text.replace(vbCrLf, "<br>")

"Saber" <saber[--AT--]maghalat.com> wrote in message news:u9*************@TK2MSFTNGP10.phx.gbl...
I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR> one by
one?

Nov 18 '05 #4
Thanks All,
I didn't knew there is such a good function.
thanks again

"Jos" <jo***************@fastmail.fm> wrote in message
news:uw****************@tk2msftngp13.phx.gbl...
Saber wrote:
I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR>
one by one?


You didn't say which language you use.

This is for VB:
Dim Text2 As String = TextBox1.Text.Replace(vbCRLF,"<BR>")

--

Jos

Nov 18 '05 #5
Saber wrote:
I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR> one by
one?

use the replace(textvar,IDCRs,"<br>")

where IDCRs is the chr()
Nov 18 '05 #6

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

Similar topics

3
by: ribchr00 | last post by:
Hi all, I would like to replace line breaks such '+' with '<br />'. Easy task. Problems start when I try to only replace lines that do not end with HTML tags. I tried preg_replace("/+/", "<br...
4
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
6
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with...
7
by: noor.rahman | last post by:
I have an XML file that stores data from an HTML form. I use XSL to display the data in HTML format. The data may have newline characters. However, XSL is not displaying the newlines properly in...
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
2
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
1
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
1
by: susikaufmann2003 | last post by:
Hello, i have a html text, where it is possible (using ajax) to edit the text by clicking on it. The text is then shown in a textarea. My problem is, that the newlines are not displayed in the...
7
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.