Article View: pl.comp.lang.perl
Article #401Re: Jak usunac zbedne spacje
From: Piotr Piatkowski
Date: Mon, 23 Jun 1997 15:41
Date: Mon, 23 Jun 1997 15:41
13 lines
1062 bytes
1062 bytes
Robert Nosko <robertn@dawid.com.pl> wrote:
: Witam,
: problem jak w tytule.
: Czy istnieje jakas funkcja w Perlu, ktora wywala zbedne spacje, np. ktos omylkowo wprowadzil takowe na koncu tekstu, albo podwojne miedzy wyrazami.
$x =~ s/ +/ /g;
$x =~ s/^ *| *$//g;
P.S. Przydałoby się też: $list =~ s/(.{1,70}) /$1\n/g;
--
Piotr Piątkowski, Uczelniane Centrum Informatyki, AGH Krakow, POLAND
Technical Details
Message-ID:
<5om5eu$pq0$1@galaxy.uci.agh.edu.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!ict.pwr.wroc.pl!agh.edu.pl!agh.edu.pl!not-for-mailReferences:
<01bc7fbc$3789fae0$044675c3@kinga.dawid.com.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!ict.pwr.wroc.pl!agh.edu.pl!agh.edu.pl!not-for-mail From: kompas@galaxy.uci.agh.edu.pl (Piotr Piatkowski) Newsgroups: pl.comp.lang.perl Subject: Re: Jak usunac zbedne spacje Date: 23 Jun 1997 17:41:18 +0200 Organization: University of Mining & Metallurgy Lines: 13 Message-ID: <5om5eu$pq0$1@galaxy.uci.agh.edu.pl> References: <01bc7fbc$3789fae0$044675c3@kinga.dawid.com.pl> NNTP-Posting-Host: galaxy.uci.agh.edu.pl Mime-Version: 1.0 X-Newsreader: TIN [UNIX 1.3 unoff BETA 970307; sun4m SunOS 5.5.1] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit