1
0
Fork 0
mirror of https://github.com/CorentinTh/it-tools.git synced 2025-07-20 21:59:36 +02:00
it-tools/utils/string.ts

8 lines
216 B
TypeScript
Raw Normal View History

import {random} from './random'
2021-03-14 20:11:39 +01:00
const capitalise = (s: string) => s.charAt(0).toUpperCase() + s.slice(1)
2021-02-13 19:55:45 +01:00
const shuffle = (s: string) => s.split('').sort(() => 0.5 - random()).join('')
2021-03-14 20:11:39 +01:00
export {capitalise, shuffle}