On Jul 28, 10:12 am, chandan_28...@yahoo.com (Chandan Kumar) wrote:
> Hi ,
>
> using split ,I would like to split on space character. Dont want to use
> character classes.
> my $string="108 ambulance 100\nfireengine141jack";
>
> my @array = split /' '/,$string;
>
From the doc: perldoc -f s
On 07/28/10 19:12, Chandan Kumar wrote:
using split ,I would like to split on space character. Dont want to use
character classes.
my $string="108 ambulance 100\nfireengine141jack";
my @array = split /' '/,$string;
foreach my $value (@array){
print "$value \n";
}
Result : its splitting on new
On Wednesday 28 Jul 2010 20:12:15 Chandan Kumar wrote:
> Hi ,
>
> using split ,I would like to split on space character. Dont want to use
> character classes. my $string="108 ambulance 100\nfireengine141jack";
>
> my @array = split /' '/,$string;
>
You need «my @array = split / /, $string;»
Hi ,
using split ,I would like to split on space character. Dont want to use
character classes.
my $string="108 ambulance 100\nfireengine141jack";
my @array = split /' '/,$string;
foreach my $value (@array){
print "$value \n";
}
Result : its splitting on new line character.instead of spa
Thanks guys, I could able to understand split fun.
--- On Mon, 19/7/10, John W. Krahn wrote:
From: John W. Krahn
Subject: Re: usage of Split on pattern matching
To: "Perl Beginners"
Date: Monday, 19 July, 2010, 4:29 PM
Chandan Kumar wrote:
> Hi all,
Hello,
> Iam beginner
Chandan Kumar wrote:
Hi all,
Hello,
Iam beginner to perl& i have a small query on split.
using split i want print everything even the character used to split on string.
Here is my example :
my $string = "hi123now456itstimeforsplit789right"
my @array = split ( '/(\d+\s)/ ',$string);
## Try
On Mon, Jul 19, 2010 at 08:14, Chandan Kumar wrote:
snip
> my $string = "hi123now456itstimeforsplit789right"
> my @array = split ( '/(\d+\s)/ ',$string);
snip
> When I run the program ,it prints the whole string. so my assumption is wrong.
>
> please Could some one explain me on this?
snip
The s
Hi all,
Iam beginner to perl & i have a small query on split.
using split i want print everything even the character used to split on string.
Here is my example :
my $string = "hi123now456itstimeforsplit789right"
my @array = split ( '/(\d+\s)/ ',$string);
## Trying to split using digitnumbe