By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,762 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,762 IT Pros & Developers. It's quick & easy.

replace in string

P: 2
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)

Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,366
That's because it's carriage return then line feed, not the other way around.
Jun 26 '12 #2

NeoPa
Expert Mod 15k+
P: 31,489
Simply :
Expand|Select|Wrap|Line Numbers
  1. newString = Replace(newString, "<br>", vbNewLine)
Jun 27 '12 #3

P: 2
Thank you very much. That was the solution. :-)
Jun 27 '12 #4

Post your reply

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