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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stripping String of \n

Status
Not open for further replies.

NashTrump

Technical User
Jul 23, 2005
38
0
0
GB
Hi There,

Im looking at some data and extracting the bits i need using perl.
Im getting quite alot of success considering ive only started looking at perl in the last month.

However when i extract a certain string from a html page i always get things like \n and \r at the end of the string.

Any idea how i strip this so i only save the word i.e

Test\r\n should be saved as Test.

Thanks in advance.

Kind regards

Nash
 
chomp
also
Code:
$string=~ s/\r\n//g;

HTH

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Thanks Paul!! thats sorted it!.

Simple regular expression ay... i'll learn up on that..
Thanks for pointing me in right direction.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top