in reply to How to ignore/replace all whitespaces,tab spaces, new line from a given string in REGEX ??

By "ignore", do you mean "remove"?
$name =~ s/\s+//g;
  • Comment on Re: How to ignore/replace all whitespaces,tab spaces, new line from a given string in REGEX ??
  • Download Code

Replies are listed 'Best First'.
Thanks !! (Re: How to ignore/replace all whitespaces,tab spaces, new line from a given string in REGEX ??)
by sugarkannan (Novice) on Nov 21, 2005 at 14:54 UTC
    Thanx a lot !! It worked for me !!

    -Sugar
      Keep in mind that will remove the spaces between words too. If you just want to remove the leading and trailing spaces, use:
      $name =~ s/^\s+//; $name =~ s/\s+$//;