Function safeReplaceString
- safeReplaceString(
source: string,
str: string,
newStr: string,
__namedParameters?: {
append?: boolean;
notFoundCallback?: () => void;
prepend?: boolean;
replaceAll?: boolean;
},
): string Parameters
- source: string
- str: string
- newStr: string
- __namedParameters: {
append?: boolean;
notFoundCallback?: () => void;
prepend?: boolean;
replaceAll?: boolean;
} = {}
Returns string
Replace a string in a text, optionally prepending, appending, replacing all occurrences, and/or calling a callback if the string is not found