I use currently the following approach: ```fun Str...
# stdlib
v
I use currently the following approach:
Copy code
fun String.countMatches(sub: String): Int {
  return (this.length - this.replace(sub, "").length) / sub.length;
}`