[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-web
Subject:    RE: taking the extra spaces out..
From:       william.meitzen () aggreko ! com
Date:       2000-11-27 14:50:41
[Download RAW message or body]

Try this:
$test =~ s/  / /g;
Or, possibly better:
$test =~ s/(\s)+/$1/g;

-WM   <><

-----Original Message-----
From: Johnno [mailto:valentine@xtra.co.nz]
Sent: Friday, November 24, 2000 5:25 AM
To: perl-win32-web@listserv.ActiveState.com
Subject: taking the extra spaces out..


Hello,

I was wondering if any knew of a way to taking out 2 spaces and just leave
one..

ie..  hello   world = hello world..

when i tried i got all sorts of problems..  the piece of code i was using
is..

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

any ideas??

Johnno



_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>RE: taking the extra spaces out..</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Try this:</FONT>
<BR><FONT SIZE=2>$test =~ s/&nbsp; / /g;</FONT>
<BR><FONT SIZE=2>Or, possibly better:</FONT>
<BR><FONT SIZE=2>$test =~ s/(\s)+/$1/g;</FONT>
</P>

<P><FONT SIZE=2>-WM&nbsp;&nbsp; &lt;&gt;&lt;</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Johnno [<A \
HREF="mailto:valentine@xtra.co.nz">mailto:valentine@xtra.co.nz</A>]</FONT> <BR><FONT \
SIZE=2>Sent: Friday, November 24, 2000 5:25 AM</FONT> <BR><FONT SIZE=2>To: \
perl-win32-web@listserv.ActiveState.com</FONT> <BR><FONT SIZE=2>Subject: taking the \
extra spaces out..</FONT> </P>
<BR>

<P><FONT SIZE=2>Hello,</FONT>
</P>

<P><FONT SIZE=2>I was wondering if any knew of a way to taking out 2 spaces and just \
leave</FONT> <BR><FONT SIZE=2>one..</FONT>
</P>

<P><FONT SIZE=2>ie..&nbsp; hello&nbsp;&nbsp; world = hello world..</FONT>
</P>

<P><FONT SIZE=2>when i tried i got all sorts of problems..&nbsp; the piece of code i \
was using</FONT> <BR><FONT SIZE=2>is..</FONT>
</P>

<P><FONT SIZE=2>$text =~ s/\&nbsp; /\ /g;</FONT>
</P>

<P><FONT SIZE=2>any ideas??</FONT>
</P>

<P><FONT SIZE=2>Johnno</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>Perl-Win32-Web mailing list</FONT>
<BR><FONT SIZE=2>Perl-Win32-Web@listserv.ActiveState.com</FONT>
<BR><FONT SIZE=2><A HREF="http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web" \
TARGET="_blank">http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web</A></FONT>
 </P>

</BODY>
</HTML>


_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic