akm2 has asked for the wisdom of the Perl Monks concerning the following question:
My fellow monks, I sit before my window to the all-mighty monastery (thats means my monitor) in a state of confussion. I seek to be enlightened by those of greater wisdom.
I am trying to use a regular expression to convert the string (without the quotation marks, of course) below.
"AGC LCD-S 8 12X12 WHITE"
I run the following expression on the string:
($BKSIC_MODEL[$i]) = substr ($line, 3, 7) =~ m/^\s*(.*)\s*$/;
You would expect $BKSIC_MODEL[$i]'s content to equal "LCD-S" (without the quotation marks, of course) right?
Well the result I get is: " LCD-S " (without the quotation marks, of course).
Please help me slove this strange problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing spaces, again.
by larryl (Monk) on Mar 16, 2001 at 01:40 UTC | |
|
Re: Removing spaces, again.
by buckaduck (Chaplain) on Mar 16, 2001 at 02:37 UTC | |
|
Re: Removing spaces, again.
by dfog (Scribe) on Mar 16, 2001 at 01:33 UTC | |
by merlyn (Sage) on Mar 16, 2001 at 01:50 UTC | |
by Gloom (Monk) on Mar 16, 2001 at 19:30 UTC | |
|
Re: Removing spaces, again.
by McD (Chaplain) on Mar 16, 2001 at 02:43 UTC | |
by buckaduck (Chaplain) on Mar 16, 2001 at 03:17 UTC | |
by McD (Chaplain) on Mar 16, 2001 at 04:13 UTC | |
by buckaduck (Chaplain) on Mar 16, 2001 at 04:46 UTC |