replaceAllIfPresent

open fun replaceAllIfPresent(stringToReplace: String, regex: String, stringCreator: StringCreator): String

Replaces all instances of the given regex with the string returned from stringCreator. The difference from normal String.replaceAll is that stringCreator is only run if a match is found.