/**
 * This function takes a string and a character as input and replaces every occurrence
 * of the character in the string with a specific string value.
 *
 * @param string The input string where characters will be replaced.
 * @param char The character to be replaced in the string.
 * @return The modified string with the character replaced.
 * @throws IllegalArgumentException If the input string is empty or null.
 */
fun replaceCharWithString(string: String, char: Char): String {

    if (string.isEmpty()) {
        throw IllegalArgumentException("Invalid input string")
    }

    var result = ""
    for (i in string.indices) {
        // Check if the current character of the string is equal to the specified character
        if (string[i] == char) {
            // Replace the character with a specific string value
            result += "Nurse"
        } else {
            result += string[i]
        }
    }

    return result
}
/**
 * This function takes a string and a character as input and replaces every occurrence
 * of the character in the string with a specific string value.
 *
 * @param string The input string where characters will be replaced.
 * @param char The character to be replaced in the string.
 * @return The modified string with the character replaced.
 * @throws IllegalArgumentException If the input string is empty or null.
 */
fun replaceCharWithString(string: String, char: Char): String {
/**
 * This function takes a string and a character as input and replaces every occurrence
 * of the character in the string with a specific string value.
 *
 * @param string The input string where characters will be replaced.
 * @param char The character to be replaced in the string.
 * @return The modified string with the character replaced.
 * @throws IllegalArgumentException If the input string is empty or null.
 */
fun replaceCharWithString(string: String, char: Char): String {

    if (string.isEmpty()) {
        throw IllegalArgumentException("Invalid input string")
    }

    var result = ""
    for (i in string.indices) {
        // Check if the current character of the string is equal to the specified character
        if (string[i] == char) {
            // Replace the character with a specific string value
            result += "Nurse"
        } else {
            result += string[i]
        }
    }

    return result
}