S
Shashank Khanvilkar
Hi,
Suppose I have a variable defined as:
$a = "This is a good example";
Note that there are multiple blanks between the words.
If i want to convert the above string to
$b = "This is a good example"
Is there any shortcut to do the above.
I know the long way as
@a_T = split(/\s/, $a);
foreac $i (@a_T){
if ($i){
$b = $b.$i." ";
}
}
I want to use substitute but canot seem to get it right..
Thanks for any help
Shashank
Suppose I have a variable defined as:
$a = "This is a good example";
Note that there are multiple blanks between the words.
If i want to convert the above string to
$b = "This is a good example"
Is there any shortcut to do the above.
I know the long way as
@a_T = split(/\s/, $a);
foreac $i (@a_T){
if ($i){
$b = $b.$i." ";
}
}
I want to use substitute but canot seem to get it right..
Thanks for any help
Shashank