📅  最后修改于: 2022-03-11 14:48:31.438000             🧑  作者: Mango
export function capitalize(str: string, all: boolean = false) {
if (all)
return str.split(' ').map(s => capitalize(s)).join(' ');
return str.charAt(0).toUpperCase() + str.slice(1);
}