Replace() problem


Indy500

Recommended Posts

Using version 5.84 build 1636. NOTE: In all the examples below, everywhere there is a backslash one three backslash one zero it is really backslash zero one three backslash zero one zero but the forum software keeps removing the leading zero...

I have a string "MyString":

? MyString
person1@test.com\13\10person2@test.com\13\10person3@test.com

I want to replace the carriage return line feed with ", ". I try:

global newString = Replace(MyString, "\13\10", ", ")
? newString
person1@test.com\13\10person2@test.com\13\10person3@test.com

global newString = Replace(MyString, "\r\n", ", ")
? newString
person1@test.com\13\10person2@test.com\13\10person3@test.com

Why can't I replace the carriage return line feed? What am I doing wrong? Thanks!

Link to comment
Share on other sites

Does your string actually have the eight ascii characters "1310" in it, or is that just from the monitor where it actually is the two characters for CRLF? I think the second because I did this:

global string x = "abcd1310def1310fdjd"

? replace(x, "1310"," ,")

and it worked. If it is that, then you want:

replace(MyString, chr(13) + chr(10) , ", ")

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.