develooper Front page | perl.beginners | Postings from May 2011

Re: gettting rid of whitespace characters

Thread Previous
From:
Shawn H Corey
Date:
May 10, 2011 10:31
Subject:
Re: gettting rid of whitespace characters
Message ID:
4DC97661.9080100@ncf.ca
On 11-05-10 01:25 PM, Irene Zweimueller wrote:
> I tied to get rid of whitespace characters by the following programme:
>
> my $i="		       USEFUL               	";

$i =~ s/\s//g;

The /g modifier means to repeatly look for the pattern.

See:
perldoc perlretut and search for /Global matching/
perldoc perlre and search for /Modifiers/


-- 
Just my 0.00000002 million dollars worth,
   Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

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