fad3r wrote:
>>Hi everyone,
>>
>>I would like to remove x amount of characters from a
>>filename (x will be whatever number the user
>>provides).
>>
>>I know how to grab the input from the user but what
>>I dont know how to do is have the program remove that
>>many characters from the filename.  I know the filename can be made a string 
>>in a variabe. I was looking at regular expressions and the . to match for any 
>>character but I am unsure if this is the best way to go.  
> 
> 
> Is this the best way to do what I am trying to accomplish?
> 
> I am kind of lost on what to research.  

Not sure where in the string that you want to remove characters, but to,
for example, delete first 5 chars of a string you could use substr or a
RE:

        $str = substr $str, 5;
        $str =~ s/^.{5,5}//;

Substr would be the simplest/fastest way to remove/extract arbitrary
characters from a string.

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to