trimPrefix


Description:

public static string trimPrefix (string? s, string prefix)

Remove the specified prefix from the string if present.

Example:

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

Parameters:

s

the string.

prefix

the prefix to remove.

Returns:

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