We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
之前做随机字符串的获取,都是先定义好一些字符串,然后在其中随机获取一些拼接起来,这样有些麻烦。今天学到一种新的获取方式
Math.random().toString(36) // "0.p1y8abl3of" // 所以可以进行截取, 比如截取长度为5的 Math.random().toString(36).substr(2, 5) // "a0jzl" // 如果不想包含数字,可以写正则表达式 Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5) // "iggav"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
之前做随机字符串的获取,都是先定义好一些字符串,然后在其中随机获取一些拼接起来,这样有些麻烦。今天学到一种新的获取方式
The text was updated successfully, but these errors were encountered: