control-freak-ide/Control-Freak-Documentation/jQuery/docs/entries/jQuery.trim.json
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

1 line
1.1 KiB
JSON

{"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<pre id=\"original\"></pre>\n<pre id=\"trimmed\"></pre>\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 <p>The <code>$.trim()</code> 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.</p>\n "}]}