Ajey Kulkarni wrote:
Thanks a ton Gunnar,
How about the intermediate blanks? Is there a way to recursively
take all blanks/tabs that occur??
word=Detail Design Activity Included#
I would like to remove the blanks here..
Recursion is not required.
$word =~ tr/ \t//d;
John
--
use Perl;
program
fulfil
Ajey Kulkarni wrote:
#snippet to replace all the ,, with ,NEW,
my($word) = " Detail Design Activity Included ,-1,0
,hello,ajey ";
$word =~ s/\s+//g;
$word =~ s/,,/,NEW,/gc;
The /c modifier is redundant, which Perl would have told you if warnings
had been enabled. :(
Ple
One more extension to this qn.
#snippet to replace all the ,, with ,NEW,
my($word) = " Detail Design Activity Included ,-1,0
,hello,ajey ";
$word =~ s/\s+//g;
$word =~ s/,,/,NEW,/gc;
printf "word=$word#\n";
after removing the blanks ,if there are any ",," i would like
Ajey Kulkarni wrote:
Gunnar Hjalmarsson wrote:
Ajey Kulkarni wrote:
I would like to remove all the spaces & tabs from a variable.
No, you wouldn't. You would like to remove possible whitespace from
the beginning and end of a string.
my($word) = " Detail Design Activity Included ";
$word =
Thanks a ton Gunnar,
How about the intermediate blanks? Is there a way to recursively
take all blanks/tabs that occur??
word=Detail Design Activity Included#
I would like to remove the blanks here..
TIA
-Ajey
On Sun, 17 Oct 2004, Gunnar Hjalmarsson wrote:
> Ajey Kulkarni wrote:
> > I would lik
Ajey Kulkarni wrote:
I would like to remove all the spaces & tabs from a variable.
No, you wouldn't. You would like to remove possible whitespace from the
beginning and end of a string.
my($word) = " Detail Design Activity Included ";
$word =~ s/^\s*(\D*)\s*$/$1/;
It's best done using t