removeOptionalPrefix

fun String.removeOptionalPrefix(prefix: String, ignoreCase: Boolean = false): Pair<String, Boolean>

Return

a pair of this string without prefix and a boolean value indicating whether the prefix was removed. If the prefix is not present, the string is returned as is and the boolean value is false

Parameters

prefix

prefix to remove

ignoreCase

whether to ignore case when searching for the prefix