Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] ltrim & rtrim

Expand Messages
  • Smith, Sheldon
    See the substr function. $year = substr( $year, 1); $cost = substr($cost, 0, length($cost)-1); OR: Use the substitute operation. $year =~ s/^ //; $cost =~
    Message 1 of 1 , Mar 1 7:41 PM
    • 0 Attachment
      See the "substr" function.
          $year = substr( $year, 1);
          $cost = substr($cost, 0, length($cost)-1);
       
      OR:
      Use the substitute operation.
          $year =~ s/^\"//;
          $cost =~ s/\"$//;
       
      Hope this helps....
      -----Original Message-----
      From: Chris Brown [mailto:chris.brown@...]
      Sent: Thursday, March 01, 2001 6:55 PM
      To: perl-beginner@yahoogroups.com
      Subject: [PBML] ltrim & rtrim

      is there an easy equivalent in perl to the old basic 'ltrim' and 'rtrim', ie. chop off the first character / last character of a variable?
       
      i've got it down to
       
      $year         "1999
      $cost        4000"
       
      and want to get rid of the " signs!
       
      cheers
      chris
    Your message has been successfully submitted and would be delivered to recipients shortly.