473,399 Members | 2,858 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,399 software developers and data experts.

replace in string

How can I replace the string (newString)

<br>
<br>

by for example

<br>

I tried the following
Expand|Select|Wrap|Line Numbers
  1. repl="<br>" & Chr(10) & Chr(13) & "<br>" & Chr(10) & Chr(13)"
  2. new="<br>"
  3. newString = Replace(newString, repl, new)
But it's not working.
Jun 26 '12 #1

✓ answered by NeoPa

Simply :
Expand|Select|Wrap|Line Numbers
  1. newString = Replace(newString, "<br>", vbNewLine)

3 1971
Rabbit
12,516 Expert Mod 8TB
That's because it's carriage return then line feed, not the other way around.
Jun 26 '12 #2
NeoPa
32,556 Expert Mod 16PB
Simply :
Expand|Select|Wrap|Line Numbers
  1. newString = Replace(newString, "<br>", vbNewLine)
Jun 27 '12 #3
Thank you very much. That was the solution. :-)
Jun 27 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: beliavsky | last post by:
The code for text in open("file.txt","r"): print text.replace("foo","bar") replaces 'foo' with 'bar' in a file, but how do I avoid changing text inside single or double quotes? For making...
7
by: ajikoe | last post by:
Hello, I would like to replace string with different values, For example : source = 'kode1 bla bla kode1 bla kode1' I have a list with each member will replace each of kode1. L = So the new...
1
by: Neil Zanella | last post by:
Hello, The MSDN documentation does not seem to mention whether the Replace string method returns a new string or modifies the existing string in place and then returns it. I would like to know...
2
by: Dmitriy Kolesnik | last post by:
Hello, all! I don't know how I can replace specified string in the txt-file from one to another. Thank You. -- __________________
6
by: localhost | last post by:
I have a string that looks like this: "document.form1.textBox1.focus ();document.form1.textBox1.select();" I want to replace the text between "document.form1." and ".focus()", as well as...
21
by: gary | last post by:
How would one make the ECMA-262 String.replace method work with a string literal? For example, if my string was "HELLO" how would I make it work in this instance. Please note my square...
0
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
3
by: Hvid Hat | last post by:
Hi I want to highlight (make it bold) a word in some text I'm getting in XML format. My plan was to replace the word with a bold (or span) tag with the word within the tag. I've found the code...
5
by: Unknown | last post by:
Hi, I've got this code : cb = open("testfile", "r+") f = cb.readlines() for line in f: rx = re.match(r'^\s*(\d+).*', line) if not rx: continue else:
3
by: omar999 | last post by:
im trying to replace NULL with N/A but I think I have a syntax error .. how do you replace string on recordset via classic asp so on objRS17and18("Price_Band_1") should it be something like ...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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.