Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    138

    Unanswered: How can I trim leading white space in the $text = “ Now is the time”;

    How can I trim leading white space in the $text = “ Now is the time”;

  2. #2
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    167
    $string =~ s/^\s+//;
    board.perl-community.de - The German Perl-Community

  3. #3
    Join Date
    Oct 2003
    Posts
    138
    thank you,
    valexena.

  4. #4
    Join Date
    Nov 2003
    Posts
    65

    Re: How can I trim leading white space in the $text = “ Now is the time”;

    i usually use the following when trimming spaces on strings:
    Code:
    	    s/^\s+//;
    	    s/\s+$//;
    i know its probably more information but its good to know more =)

    Originally posted by valexena
    How can I trim leading white space in the $text = “ Now is the time”;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •