移除字符串中指定的前缀
原始字符串
需要移除的前缀
移除前缀后的字符串,如果原始字符串不以该前缀开头则返回原字符串
console.log(removePrefix("hello world", "hello ")); // -> "world"console.log(removePrefix("__hello__", "__")); // -> "hello__"console.log(removePrefix("test", "no")); // -> "test"console.log(removePrefix(null, "prefix")); // -> "" Copy
console.log(removePrefix("hello world", "hello ")); // -> "world"console.log(removePrefix("__hello__", "__")); // -> "hello__"console.log(removePrefix("test", "no")); // -> "test"console.log(removePrefix(null, "prefix")); // -> ""
移除字符串中指定的前缀