📅  最后修改于: 2022-03-11 15:02:58.758000             🧑  作者: 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);
}