To replace a string with another

2001-06-27 Thread Stéphane JEAN BAPTISTE


Hi.
I want to replace the String  %0A by nothing. I'm using this line:
   $description=~tr/%0A//;

But nothing change.

What is my problem ?

tks




RE: To replace a string with another

2001-06-27 Thread John Edwards

Try escaping the % symbol.

   $description=~tr/\%0A//;


See this link for an explanation.

http://www.netcat.co.uk/rob/perl/win32perltut.html#38-Escaping

-Original Message-
From: Stéphane JEAN BAPTISTE
[mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 15:12
To: PERL
Subject: To replace a string with another



Hi.
I want to replace the String  %0A by nothing. I'm using this line:
   $description=~tr/%0A//;

But nothing change.

What is my problem ?

tks



--Confidentiality--.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.





Re: To replace a string with another

2001-06-27 Thread Chas Owens

On 27 Jun 2001 16:11:56 +0200, Stéphane JEAN BAPTISTE wrote:
 
 Hi.
 I want to replace the String  %0A by nothing. I'm using this line:
$description=~tr/%0A//;
 
 But nothing change.
 
 What is my problem ?
 
 tks
 

tr is not what you want.  tr replaces characters with other characters.
You want s:

$desc =~ s/%0A//g;

--
Today is Pungenday, the 32nd day of Confusion in the YOLD 3167
You are what you see.





Re: To replace a string with another

2001-06-27 Thread Stéphane JEAN BAPTISTE



Stéphane JEAN BAPTISTE a écrit :

 Hi.
 I want to replace the String  %0A by nothing. I'm using this line:
$description=~tr/%0A//;

 But nothing change.

 What is my problem ?

 tks

PS: There is'nt only 1 string but a lot.