Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS-正则 #6

Open
XinChou16 opened this issue Jan 31, 2018 · 1 comment
Open

JS-正则 #6

XinChou16 opened this issue Jan 31, 2018 · 1 comment

Comments

@XinChou16
Copy link
Owner

test

@XinChou16
Copy link
Owner Author

XinChou16 commented Feb 26, 2018

正则去空格

function trim(str){
  return str.replace(/^\s+|\s+$/g,'')
}


console.log( trim(' zhouxin  ') )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant