count

fun String.count(substring: String): Int

It counts the occurrences of a given substring in a text.

Return

the number of occurrences of the substring.

Parameters

substring

the substring to count.

Sources

Link copied to clipboard