update
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
export function makeFirstCharUpper(val: string) {
|
||||
if (val === "") return val;
|
||||
const firstChar = val.at(0)?.toLocaleUpperCase() || "";
|
||||
const otherChar = val.slice(1);
|
||||
return firstChar + otherChar;
|
||||
// Utility functions
|
||||
|
||||
/**
|
||||
* Makes the first character of a string uppercase.
|
||||
* @param str - The string to transform.
|
||||
* @returns The transformed string.
|
||||
*/
|
||||
export function makeFirstCharUpper(str: string): string {
|
||||
if (!str) return "";
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user