2021-08-31 22:00:56 -07:00
|
|
|
export function capitalizeFirstLetter(str?: string | null) {
|
|
|
|
if (!str) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
2021-04-23 00:18:39 -07:00
|
|
|
}
|
2022-01-27 10:33:12 -08:00
|
|
|
|
|
|
|
export function lowerFirstLetter(str?: string | null) {
|
|
|
|
if (!str) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
|
|
}
|
2022-02-02 13:51:39 -08:00
|
|
|
|
|
|
|
export function capitalizeFirstLetterOnly(str?: string | null) {
|
|
|
|
if (!str) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
|
}
|
2022-03-24 02:05:45 +05:30
|
|
|
|
|
|
|
export function groupIdTextValidation(str: string) {
|
|
|
|
if (str.indexOf(' ') > 0) return false;
|
|
|
|
if (str.indexOf(',') > 0) return false;
|
|
|
|
if (str.indexOf('(') > 0) return false;
|
|
|
|
if (str.indexOf(')') > 0) return false;
|
|
|
|
if (str.indexOf(':') > 0) return false;
|
|
|
|
return true;
|
|
|
|
}
|