For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2006 > perl string truncation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author perl string truncation
ada

2006-10-20, 3:58 am

I have a string like "group1, name1" and i just want to take name1. Do
you have any opinion on how to do this?

Ram Prasad

2006-10-20, 7:57 am


ada wrote:
> I have a string like "group1, name1" and i just want to take name1. Do
> you have any opinion on how to do this?


take name1 and do what ?

If you want to use it in a variable do this

$str = "group1, name1";
my($var1,$var2) = split(/,/,$str);

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com