std.replace_prefix()

Replaces the literal string pattern in string s with replacement, if s begins with that prefix.

This corresponds to std.prefixof(s, pattern) returning true. If pattern is the empty string, the original string s is returned.

Format

STRING
std.replace_prefix(STRING s, STRING pattern STRING replacement)

Examples

1
std.replace_prefix("0xABCD1234", "0x", "") # returns "ABCD1234"