Encodes leading and leading space characters in addition to breaking spaces \u00A0- this is a unicode point / code / number / alias for a non-working space. You can open Firebug and enter it.
>>> '\u00A0'
" "
Additional information about this character:
http://www.fileformat.info/info/unicode/char/00a0/index.htm
Edit: I just tried this code in Firebug, which checks for matches from the generated non-decaying space and matches:
javascript:alert( String.fromCharCode(160).match(/\s/) )
, IE6 null, IE, , .
Update # 2 - , , , -.
r = /(\s|\u00A0)+|(\s|\u00A0)+$/g;
s = ' wh at'
s = s.replace( r, '' )
"what"