develooper Front page | perl.beginners | Postings from March 2002

RE: remove a char

Thread Previous
From:
Michael Gargiullo
Date:
March 29, 2002 08:01
Subject:
RE: remove a char
Message ID:
NGBBJEADBDIGMPLAMOCNEEDKCCAA.gargiullo@comcast.net
Thank you!!

-----Original Message-----
From: John W. Krahn [mailto:krahnj@acm.org]
Sent: Friday, March 29, 2002 3:34 AM
To: beginners@perl.org
Subject: Re: remove a char


Michael Gargiullo wrote:
>
> In an array say @randomWord
>
> The second position could contain one of a thousand words, but the words
all
> end with a comma.  How can I strip that comma?
>
> I've tried using:
>
> $_=$randomWord[1];
> /(.*.),/;
> $randomWord[1] = $_;
>
> But this is not working, any sugestions?


$randomWord[1] =~ tr/,//d;


John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About