For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2007 > Re: string manip. @ 1171669455









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 Re: string manip. @ 1171669455
Johan Meskens CS3 jmcs3

2007-02-16, 6:59 pm



Intrah onat Diria .. Fri, 16 Feb 2007 15:08:02 -0800
, "Nishi Bhonsle" wrote "Revera y":



> Thanks.
>
> How can i achieve that?



my $s = 'instance/bit/bitGroup/default/tz/l_cs';
$s =~ /.*\/(.*)$/;
print $1;


> $mylang = l_cs, in the above example.
> I have to get the last directory and assign it to a var such as
>
> where the last directory stands for os languages.
> instance/bit/bitGroup/default/tz/l_cs
> I have a string such as
>
> Hi:








--------the following could be unreadable @ 1171669532 :::
conscious
, or
, |
, <1158956691.10492::
, DIFFERENTLY
, the
, |
, nbeing
, .
, |
, THE_ALGONERIC_LIBRARY
, 0.834936931321728
,




DJ Stunks

2007-02-17, 7:58 am

On Feb 16, 4:45 pm, johanmeskens...@chromaticspaceandworld.com (Johan
Meskens CS3 jmcs3) wrote:
> my $s = 'instance/bit/bitGroup/default/tz/l_cs';
> $s =~ /.*\/(.*)$/;
> print $1;


use File::Basename;
print basename( $s );

-jp

Sponsored Links







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

Copyright 2008 codecomments.com