Skip to content

Instantly share code, notes, and snippets.

@conanak99
Created December 11, 2020 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conanak99/c66452527efe4a67959f93406d12e8fb to your computer and use it in GitHub Desktop.
Save conanak99/c66452527efe4a67959f93406d12e8fb to your computer and use it in GitHub Desktop.
// Code bỏ kí tự đặc biệt và viết hoa
let input = 'abd4%$#@#';
input = input.trim().replace(/[^a-zA-Z ]/g, "").toUpperCase()
// Đoạn code khác ...
// Copy lần 1
const username = 'ahihi-de-em-di'
const trimmedUsername = username.trim().replace(/[^a-zA-Z ]/g, "").toUpperCase()
// ...Copy tiếp logic qua đoạn khác
const id = 'jro@091ksa'
return id.trim().replace(/[^a-zA-Z ]/g, "").toUpperCase()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment