The strings.Replace function counts the number of replacements. If 0, the original string is returned. Hence, there is no need to check if a replacement will happen before doing the work.