Replace Function

a1jit

Regular
Joined
Aug 19, 2005
Messages
89
Hi Guys,

I was just thinking wheather how do i do this

I want to do some replace operation, for an example, i want to replace
the "\r\n" string with " "

So lets say i have this, it works properly.

string str = "test\r\n"

if i use a replace function here, i get only "test"

but lets say i have this

string str = "test\r\n\r\n"

how do i actually write a small function that find any combination of \r\n
and replaces it with " " ?

like if the string is "test\r\n\r\n"
It should give me "test"

Any idea?
 
Actually i have tried with the str.replace() function..
I doesnt replace
if str is below.
string str = "test\r\n\r\n"

str.replace("\r\n","") still gives me "test\r\n\r\n"
 
Back
Top