Re: truncating a string

2001-05-18 Thread Jeff Pinyan
On May 18, David Merrill said: >$title =~ s/\s*$//; > >where $title = "The Linux Programmer's Guide " > >and it is being truncated after the ' mark. All I want to do is remove >the trailing spaces from the string. Can someone please help? You've already solved your problem about single q

Re: truncating a string

2001-05-18 Thread Collin Rogowski
This should work! Can you give us a bit more context? To be precise: $title = "The Linux Programmer's Guide "; $title =~ s/\s*$//; That works. If you don't get "The Linux Programmer's Guide" there has to be something wrong in the code around that bit. cr On Fri, 18 May 2001 12:08:25

Re: truncating a string

2001-05-18 Thread David Merrill
On Fri, May 18, 2001 at 10:38:50AM -0500, John Joseph Trammell wrote: > On Fri, May 18, 2001 at 12:08:25PM -0400, David Merrill wrote: > > Hi, > > > > I'm working on my very first perl application, which is a front end to > > a database for the LDP. I am trying to truncate a string, using: > > >

Re: truncating a string

2001-05-18 Thread Gary Stainburn
Hi David, try this one. $title=~s/ *$//; it does an in-place search for all trailing spaces and replaces them with nothing. Gary On Friday 18 May 2001 5:08 pm, David Merrill wrote: > Hi, > > I'm working on my very first perl application, which is a front end > to a database for the LDP. I

Re: truncating a string

2001-05-18 Thread John Joseph Trammell
On Fri, May 18, 2001 at 12:08:25PM -0400, David Merrill wrote: > Hi, > > I'm working on my very first perl application, which is a front end to > a database for the LDP. I am trying to truncate a string, using: > > $title =~ s/\s*$//; > > where $title = "The Linux Programmer's Guide " >

Re: truncating a string

2001-05-18 Thread Jos Boumans
Try this: it just replaces MORE then one whitespace... $title = "The Linux Programmer's Guide "; $title =~ s/\s+$//; Regards, Jos David Merrill wrote: > Hi, > > I'm working on my very first perl application, which is a front end to > a database for the LDP. I am trying to truncate a

truncating a string

2001-05-18 Thread David Merrill
Hi, I'm working on my very first perl application, which is a front end to a database for the LDP. I am trying to truncate a string, using: $title =~ s/\s*$//; where $title = "The Linux Programmer's Guide " and it is being truncated after the ' mark. All I want to do is remove the trai