Function safeReplaceString
- safeReplaceString(source, str, newStr, __namedParameters?): string
-
Parameters
-
source: string
-
str: string
-
newStr: string
-
__namedParameters: {
append: undefined | boolean;
notFoundCallback: undefined | (() => void);
prepend: undefined | boolean;
replaceAll: undefined | boolean;
} = {}
-
append: undefined | boolean
-
notFoundCallback: undefined | (() => void)
-
prepend: undefined | boolean
-
replaceAll: undefined | 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