//#region src/utilities/input/StringUtilities.js
const removeWhiteSpace = (str) => {
	if (!str) return "";
	return str.replace(/\s/g, "");
};
const camelToPascalCaseWithSpace = (str) => {
	return (str.charAt(0).toUpperCase() + str.slice(1)).replace(/([a-z0-9])([A-Z])/g, "$1 $2");
};
const trimStringAfter = (str, character) => {
	const lastIndex = str.lastIndexOf(character);
	return str.substring(0, lastIndex === -1 ? str.length : lastIndex);
};
const toLowerFirstChar = (field) => {
	return field?.charAt(0)?.toLowerCase() + field?.slice(1);
};
const toUpperFirstChar = (field) => {
	return field?.charAt(0)?.toUpperCase() + field?.slice(1);
};
const toTitleCase = (str) => {
	const result = str.replace(/([A-Z][a-z]+)/g, " $1").replace(/([A-Z]+)\b/g, " $1").replace(/_/g, " ").trim();
	return result.charAt(0).toUpperCase() + result.slice(1);
};
const pluralize = (str) => {
	if (str.charAt(str.length - 1) === "s") return str;
	else return `${str}s`;
};
//#endregion
export { camelToPascalCaseWithSpace, pluralize, removeWhiteSpace, toLowerFirstChar, toTitleCase, toUpperFirstChar, trimStringAfter };

//# sourceMappingURL=StringUtilities.mjs.map