View Single Post
  #4 (permalink)  
Old 05-18-07, 07:40 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
javascript Code:
  1. value = value.replace(/[\r\n\s]+$/, '').replace(/^[\r\n\s]+/, '');

This would trim blank lines and spaces from the beginning and end of the string.
Reply With Quote