1 Replies - 1543 Views - Last Post: 19 November 2007 - 11:15 AM

#1 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6819
  • View blog
  • Posts: 31,418
  • Joined: 10-May 07

trimwhitespace

Posted 18 October 2007 - 08:19 AM

Description: Subroutine to Remove whitespace from the start and end of a string.
sub trimwhitespace {
	my ($string) = shift;
	$string =~ s/^s+//;
	$string =~ s/s+$//;
	return $string; ## Thanks KevinADC
}

Is This A Good Question/Topic? 0
  • +

Replies To: trimwhitespace

#2 KevinADC   User is offline

  • D.I.C Regular
  • member icon

Reputation: 27
  • View blog
  • Posts: 401
  • Joined: 23-January 07

Re: trimwhitespace

Posted 19 November 2007 - 11:15 AM

correction: return $string;
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1