Removes the specified suffix from a string if it exists.
The string to process.
The suffix to remove.
Optional
The string without the suffix if it was present; otherwise, returns the original string.
1.1.0
removeSuffix("running", "ing"); // "runn"removeSuffix("hello", "lo"); // "hel"removeSuffix("world", "ing"); // "world" (suffix not found) Copy
removeSuffix("running", "ing"); // "runn"removeSuffix("hello", "lo"); // "hel"removeSuffix("world", "ing"); // "world" (suffix not found)
Removes the specified suffix from a string if it exists.