/* * * Whether to remove all spaces * @param str * @param is_global If it is g or G, remove all spaces * @returns */ function Trim(str,is_global) { var result; result = str.replace(/(^s )|(s $)/g,"" ); if(is_global.toLowerCase()=="g") { result = result.replace(/s/g,""); } return result; }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn