> -----Original Message-----
> From: Toby Stuart [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 19, 2002 4:46 PM
> To: 'Octavian Rasnita'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: Chopping a string.
> 
> 
> $line = substr($line,0,19,) . "...";

$line = substr($line,0,19) . "..."; # removed the useless comma

> 
> > -----Original Message-----
> > From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 18, 2002 11:52 PM
> > To: [EMAIL PROTECTED]
> > Subject: Chopping a string.
> > 
> > 
> > Hi all,
> > 
> > I have a string $line that can be a short word or a very long 
> > line, and I
> > want to cut it if it is longer than 20 characters, then to 
> > end it with ....
> > Is there any Perl function for chopping what is over a number 
> > of characters?
> > 
> > For example I have a string:
> > 
> > $line = "Microsoft is a big company and I love Bill Gates";
> > And I want to cut it to become:
> > 
> > $line = "Microsoft is a big...";
> > 
> > Thanks.
> > 
> > Teddy Center: http://teddy.fcc.ro/
> > Mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to