Solved

Replace("<br/>", chr(10) Give Error 'chr' does not exist in the current context but works with two strings.

Posted on 2010-09-04
1
913 Views
Last Modified: 2013-12-17
This answer I found here, but it seem to work for some and not for others,  am I missing some maybe a directive of something?

the code works if i use strings only but if i try to use the the chr(10)

string j = s.Replace("<br/>", chr(10));

I get error:
The name 'chr' does not exist in the current context


Thanks for any help!
0
Comment
Question by:bmanmike39
1 Comment
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 33605480
Chr() is a legacy VB function so it will work in VB.Net apps...
You should be able to use the newline escape sequence of "\n":
    string j = s.Replace("<br/>", "\n");
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now