Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...