paulwhelan
asked on
split up text
if my variable contains
$myvar="this=is=a=test=str ing";
and i do
($x,$y)=split("=",$myvar);
then $x becomes "this"
and $y becomes "is"
but how do i split it so that
$x becomes "this"
and $y becomes "is=a=test=string";
ie $y becomes the rest of the string
thanks
$myvar="this=is=a=test=str
and i do
($x,$y)=split("=",$myvar);
then $x becomes "this"
and $y becomes "is"
but how do i split it so that
$x becomes "this"
and $y becomes "is=a=test=string";
ie $y becomes the rest of the string
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or this:
($x,@y)=split("=",$myvar);
$y=join("=",@y);
Rob
($x,@y)=split("=",$myvar);
$y=join("=",@y);
Rob
Or this:
($x,$y)=$myvar=~/^(.+?)=(. *)/;
Rob
($x,$y)=$myvar=~/^(.+?)=(.
Rob
ASKER
sorry maneshr got there first....
ASKER
it works thats the main thing
;)
;)
Try
($x,$y)=split("=",$myvar,2
Greetings.