Replace
with hex 0d 0a
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngregexp' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Rob Kaeser
How can I replace the search for "<BR>" with the hex representation of a
line feed (\0d\0a) for text files? If I pass "\x0d\x0a" in the Replace
function, it simply replaces the <BR> with a "\x0d\x0a". How can I force
it to interpret the actual hex values and write those to the string,
which I am sending to a .txt file?

Thanks,
    -ROB

Reply to this message...
 
    
Steve Sharrock (VIP)

String s = "Now is<BR>this time";

String t = s.Replace("<BR>", "\r\n" );

Be careful for upper/lower case <BR>. You might also consider a regular
expression process.

Steve Sharrock
programmer / designer
www.sharkcode.com

-----Original Message-----
From: Rob Kaeser [mailto:Click here to reveal e-mail address]
Sent: Wednesday, October 31, 2001 1:22 PM
To: aspngregexp
Subject: [aspngregexp] Replace <BR> with hex 0d 0a

How can I replace the search for "<BR>" with the hex representation of a
line feed (\0d\0a) for text files? If I pass "\x0d\x0a" in the Replace
function, it simply replaces the <BR> with a "\x0d\x0a". How can I force
it to interpret the actual hex values and write those to the string,
which I am sending to a .txt file?

Thanks,
    -ROB

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Meor Zaharin Meor Ibrahim
try Regex.Replace

-----Original Message-----
From: Rob Kaeser [mailto:Click here to reveal e-mail address]
Sent: Thursday, November 01, 2001 5:22 AM
To: aspngregexp
Subject: [aspngregexp] Replace <BR> with hex 0d 0a

How can I replace the search for "<BR>" with the hex representation of a
line feed (\0d\0a) for text files? If I pass "\x0d\x0a" in the Replace
function, it simply replaces the <BR> with a "\x0d\x0a". How can I force
it to interpret the actual hex values and write those to the string,
which I am sending to a .txt file?

Thanks,
    -ROB

| [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
 
System.Text.RegularExpressions.Regex




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com