hi,
when you want to get rid of newlines and carriage returns, is it correct to
use:
tr/\n&&\r//g; ?

below you suggested tr/\x0a\x0d//d;

what does "x0a" and "x0d" mean?

where can i get a list of all these strange characters and their meaning?

a few days ago, Bill suggested : tr/015d//g; to get rid of carriage returns;

i'm confused. pls. help.
thanks!


----- Original Message -----
From: Douglas Wilson
To: Perl-Win32-Users Mailing List
Sent: Monday, May 08, 2000 9:29 AM
Subject: Re: best way to search


On 05/08/00, ""Flynn, Timothy J" <[EMAIL PROTECTED]>" wrote:
> What is the best way to search for all printable characters.  i.e..
> I want to eliminate any characters such as \n\r etc.

> $somestring =~ s/[^0-9a-zA-Z]//g;

If the above is what you want, then use
tr:
$somestring =~ tr/0-9a-zA-Z//cd;

> I want to keep the spaces.

You can add it to the above 'keep' list (how about tabs?):
$somestring =~ tr/0-9a-zA-Z\x20\x09//cd;

Or you can figure out exactly what you DON'T want
and use something like (to get rid of newlines and
carriage returns):
$somestring =~ tr/\x0a\x0d//d;

HTH,
Douglas Wilson

---
You are currently subscribed to perl-win32-users as: [EMAIL PROTECTED]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to
         [EMAIL PROTECTED]


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to