/**
 * This function counts the number of occurrences of a given word in a string.
 *
 * @param string The input string.
 * @param word The word to be counted.
 * @return The number of occurrences of the word in the string.
 */
fun countWordsInString(string: String, word: String): Int {

    return string.split(" ").count { it == word }
}
/**
 * This function counts the number of occurrences of a given word in a string.
 *
 * @param string The input string.
 * @param word The word to be counted.
 * @return The number of occurrences of the word in the string.
 */
fun countWordsInString(string: String, word: String): Int {
/**
 * This function counts the number of occurrences of a given word in a string.
 *
 * @param string The input string.
 * @param word The word to be counted.
 * @return The number of occurrences of the word in the string.
 */
fun countWordsInString(string: String, word: String): Int {

    return string.split(" ").count { it == word }
}