Skip to content

getRandomString

获取指定长度的string

基础用法

参数名参数类型是否必传参数说明
lengthnumber字符串长度

返回

string

ts
import { getRandomString } from '@lichang666/utils'

getRandomString(2) // "lf"
getRandomString(5) // "fvead"