std.replace_prefix

STRINGstd.replace_prefixSTRINGsSTRINGtargetSTRINGreplacement

Available inall subroutines.

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

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

Example

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