去掉字符串起始和结尾的空格。
langx.trim(str)
Example: 删除在开始和在字符串的末尾两个空格。
<!DOCTYPE html> <html> <head> <style> </style> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.3/require.min.js"></script> <script> require.config({ baseUrl: "./", packages: [{ name: "skylark", location: "../../../src/skylark" }, ] }); </script> </head> <body> <span></span> <script> require(["skylark/finder", "skylark/langx", "skylark/datax"], function(finder, langx, datax) { datax.text(finder.find("span"), langx.trim(" hello, how are you? ")); }); </script> </body> </html>