{"name":"jQuery.trim","type":"method","title":"jQuery.trim()","deprecated":null,"removed":null,"desc":"Remove the whitespace from the beginning and end of a string.","categories":["utilities","version/1.0"],"entries":[{"return":"String","signatures":{"added":"1.0","argument":{"desc":"The string to trim.","name":"str","type":"String"}},"examples":[{"desc":"Remove the white spaces at the start and at the end of the string.","code":"\nvar str = \" lots of spaces before and after \";\n$( \"#original\" ).html( \"Original String: '\" + str + \"'\" );\n$( \"#trimmed\" ).html( \"$.trim()'ed: '\" + $.trim(str) + \"'\" );\n","html":"\n
\n
\n"},{"desc":"Remove the white spaces at the start and at the end of the string.","code":"\n$.trim(\"    hello, how are you?    \");\n","results":"\n\"hello, how are you?\"\n"}],"longdesc":"\n    

The $.trim() function removes all newlines, spaces (including non-breaking spaces), and tabs from the beginning and end of the supplied string. If these whitespace characters occur in the middle of the string, they are preserved.

\n "}]}