trimSuffix


Description:

public static string trimSuffix (string? s, string suffix)

Remove the specified suffix from the string if present.

Example:

    assert (Strings.trimSuffix ("HelloWorld", "World") == "Hello");
assert (Strings.trimSuffix ("HelloWorld", "Bye") == "HelloWorld");

Parameters:

s

the string.

suffix

the suffix to remove.

Returns:

string with suffix removed, or original if suffix not found.