Re: removing characters

2006-09-15 Thread Mumia W.
On 09/15/2006 12:54 AM, ubergoonz wrote: Hi, I have a certain variables of emplyee number which comes in the format of [a000] or [u000] {whereby 000 is some serial numbers}. I would like to remove the enclosed [ & ] see if it is belong to class a or u , i can do it as follow $v

Re: removing characters

2006-09-14 Thread John W. Krahn
ubergoonz wrote: > Hi, Hello, > I have a certain variables of emplyee number which comes in the format of > [a000] or [u000] {whereby 000 is some serial numbers}. > > I would like to remove the enclosed [ & ] see if it is belong to class > a or > u , i can do it as follow > > $var

Re: removing characters

2006-09-14 Thread jeffhua
Hi, You can do it like: $var =~ s/\[|\]//g; or $var =~ s/[\[\]]//g; -Original Message- From: [EMAIL PROTECTED] To: beginners@perl.org Sent: Fri, 15 Sep 2006 1:54 PM Subject: removing characters Hi, I have a certain variables of emplyee number which comes in the format of

removing characters

2006-09-14 Thread ubergoonz
Hi, I have a certain variables of emplyee number which comes in the format of [a000] or [u000] {whereby 000 is some serial numbers}. I would like to remove the enclosed [ & ] see if it is belong to class a or u , i can do it as follow $var = /\[//; $var = /\]//; if ($var =~ '^a) {

Re: Removing characters from a string

2004-05-06 Thread Rob Dixon
Charles K. Clarkson wrote: > > Rob Dixon <[EMAIL PROTECTED]> wrote: > : > : >I tried all these substitutions. Unfortunately, > : > they also destroy words in the string like can't, > : > couldn't, what's, it's, and a multitude of others. > : > Anyone with any solutions? > : > : Hi. > : > : A to

Re: Removing characters from a string

2004-05-05 Thread James Edward Gray II
On May 5, 2004, at 2:32 PM, Charles K. Clarkson wrote: Hmmm. I wonder: $_ = q|It's a winner and shouldn't fail. Unless someone were prone to separating sentences with two spaces.|; print join ' ', grep { not /^[a-z]$/i } split; I imagine we could fix that: print join '', grep { not m/^[a-z]$/

RE: Removing characters from a string

2004-05-05 Thread Charles K. Clarkson
Rob Dixon <[EMAIL PROTECTED]> wrote: : : >I tried all these substitutions. Unfortunately, : > they also destroy words in the string like can't, : > couldn't, what's, it's, and a multitude of others. : > Anyone with any solutions? : : Hi. : : A totally different solution: : : $_ = q(This i

Re: Removing characters from a string

2004-05-05 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > In a message dated 5/4/04 5:19:49 PM Eastern Daylight Time, Jimstone77 > writes: > > > > In a message dated 5/4/04 4:14:58 PM Eastern Daylight Time, > > [EMAIL PROTECTED] writes: > > > > > > >> : > >> > >> > > >> > How would I remove any and "only" single characters fro

Re: Removing characters from a string

2004-05-04 Thread Jimstone77
In a message dated 5/4/04 5:19:49 PM Eastern Daylight Time, Jimstone77 writes: > In a message dated 5/4/04 4:14:58 PM Eastern Daylight Time, > [EMAIL PROTECTED] writes: > > > >> : >> >> > >> > How would I remove any and "only" single characters from a string? >> > >> > $_ = "This is a charac

Re: Removing characters from a string

2004-05-04 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > How would I remove any and "only" single characters from a string? > > $_ = "This is a character d g string test"; > > I want this to read "This is character string test." s/(?:\s+[b-hj-z]\b|\b[b-hj-z]\s+)//ig; John -- use Perl; program fulfillment -- To unsub

Re: Removing characters from a string

2004-05-04 Thread James Edward Gray II
On May 4, 2004, at 3:05 PM, [EMAIL PROTECTED] wrote: How would I remove any and "only" single characters from a string? $_ = "This is a character d g string test"; I want this to read "This is character string test." How about: s/\b[a-zA-Z]\b//g; Hope that helps. James -- To unsubscribe, e-mail: [E

Re: Removing characters from a string

2004-05-04 Thread Andrew Gaffney
[EMAIL PROTECTED] wrote: How would I remove any and "only" single characters from a string? $_ = "This is a character d g string test"; I want this to read "This is character string test." Off the top of my head...untested: $string =~ s/ \w\b//g; -- Andrew Gaffney Network Administrator Skyline Ae

Removing characters from a string

2004-05-04 Thread Jimstone77
How would I remove any and "only" single characters from a string? $_ = "This is a character d g string test"; I want this to read "This is character string test."