fleet/frontend/utilities/strings/stringUtils.ts

12 lines
243 B
TypeScript
Raw Normal View History

/**
* Capitalizes the words of the string passed in.
* @param str un-capitalized string
*/
const capitalize = (str: string): string => {
return str.replace(/\b\w/g, (letter) => letter.toUpperCase());
};
export default {
capitalize,
};