/**
 * Given a string and a character, return the index of the first occurrence of the character in the string using loops.
 *
 * @param string a string value
 * @param character a character to find in the string
 * @return The index of the first occurrence of the character in the string, or -1 if the character is not found.
 */
fun findCharacterIndex(string: String, character: Char): Int {

    var index = -1  // Initializing index to -1 indicates that the character is not found initially
    
    for (i in string.indices) {
        if (string[i] == character) {
            index = i
            break  // Exit the loop once character is found
        }
    }
    
    return index
}
/**
 * Given a string and a character, return the index of the first occurrence of the character in the string using loops.
 *
 * @param string a string value
 * @param character a character to find in the string
 * @return The index of the first occurrence of the character in the string, or -1 if the character is not found.
 */
fun findCharacterIndex(string: String, character: Char): Int {
/**
 * Given a string and a character, return the index of the first occurrence of the character in the string using loops.
 *
 * @param string a string value
 * @param character a character to find in the string
 * @return The index of the first occurrence of the character in the string, or -1 if the character is not found.
 */
fun findCharacterIndex(string: String, character: Char): Int {

    var index = -1  // Initializing index to -1 indicates that the character is not found initially
    
    for (i in string.indices) {
        if (string[i] == character) {
            index = i
            break  // Exit the loop once character is found
        }
    }
    
    return index
}