Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing <CR> from a string var

Status
Not open for further replies.

Riegg

Programmer
Mar 20, 2003
29
CA
How can I remove a <CR> from a string var??

I would like to do it with strreplace strvar XXX &quot;&quot; but I don't know what to put for the XXX.

The strvar is a 3 line data read from the RX buffer. I need the information on the second line. I remove the first line and the last line with strreplace &quot;&quot; but I am left with the <cr>'s. Is there a better way to do it??
 
strreplace strvar &quot;`r&quot; &quot;&quot; will remove carriage returns from the string. If you also need to remove linefeeds, you can replace `r with `n.
aspect@aspectscripting.com
 
Ahhhh!!! Line Feeds!! That's why I was getting ASCII 10 when I did a strgetc. Thanks!! Now if I do one strreplace &quot;'n&quot; will that remove all linefeeds?? or just the first one.....
 
Never mind, I read the help file on strreplace and it says every time it appears in the strvar.

Thanks for all your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top