This commit is contained in:
2025-12-26 21:56:11 +08:00
parent e857204140
commit 1688124e8e
31 changed files with 256 additions and 736 deletions

View File

@@ -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);
}