RE: Chopping a string.

2002-07-19 Thread Kipp, James
perldoc substr() or perldoc rindex() > -Original Message- > From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 18, 2002 9:52 AM > To: [EMAIL PROTECTED] > Subject: Chopping a string. > > > Hi all, > > I have a string $line that can be a short word or a very long

Re: Chopping a string.

2002-07-19 Thread Janek Schleicher
Octavian Rasnita wrote at Thu, 18 Jul 2002 15:51:45 +0200: > 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? >

Re: Chopping a string.

2002-07-19 Thread Bud Rogers
Octavian Rasnita wrote: > 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? substr($string, $start, $length) > F

Re: Chopping a string.

2002-07-19 Thread Connie Chan
$line =~ s/^(.{20}).+/$1.../ ; Rgds, Connie > > > 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

RE: Chopping a string.

2002-07-18 Thread Toby Stuart
$line = substr($line,0,19,) . "..."; > -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