/**
 * Exercise:
 *
 * You are working on a game where the player has to find and kill a particular enemy character represented by a specific
 * character in the game world. However, there are multiple instances of this enemy character scattered throughout the game
 * world. Your task is to find all the occurrences of the enemy character in the given string and delete them, resulting
 * in the updated string.
 *
 * Write a function deleteCharacter that takes in two parameters:
 *
 * - string: The input string representing the game world.
 * - char: The enemy character that needs to be found and deleted.
 *
 * The function should return the updated string after deleting all occurrences of the enemy character.
 *
 * Example:
 *
 * deleteCharacter("Welcome to the jungle! Find and kill all the enemies.", '!')
 *
 * Output:
 * 'Welcome to the jungle Find and kill all the enemies.'
 */
fun deleteCharacter(string: String, char: Char): String {

    var updatedString = ""
    for (ch in string) {
        if (ch != char) {
            updatedString += ch
        }
    }
    return updatedString
}
/**
 * Exercise:
 *
 * You are working on a game where the player has to find and kill a particular enemy character represented by a specific
 * character in the game world. However, there are multiple instances of this enemy character scattered throughout the game
 * world. Your task is to find all the occurrences of the enemy character in the given string and delete them, resulting
 * in the updated string.
 *
 * Write a function deleteCharacter that takes in two parameters:
 *
 * - string: The input string representing the game world.
 * - char: The enemy character that needs to be found and deleted.
 *
 * The function should return the updated string after deleting all occurrences of the enemy character.
 *
 * Example:
 *
 * deleteCharacter("Welcome to the jungle! Find and kill all the enemies.", '!')
 *
 * Output:
 * 'Welcome to the jungle Find and kill all the enemies.'
 */
fun deleteCharacter(string: String, char: Char): String {
/**
 * Exercise:
 *
 * You are working on a game where the player has to find and kill a particular enemy character represented by a specific
 * character in the game world. However, there are multiple instances of this enemy character scattered throughout the game
 * world. Your task is to find all the occurrences of the enemy character in the given string and delete them, resulting
 * in the updated string.
 *
 * Write a function deleteCharacter that takes in two parameters:
 *
 * - string: The input string representing the game world.
 * - char: The enemy character that needs to be found and deleted.
 *
 * The function should return the updated string after deleting all occurrences of the enemy character.
 *
 * Example:
 *
 * deleteCharacter("Welcome to the jungle! Find and kill all the enemies.", '!')
 *
 * Output:
 * 'Welcome to the jungle Find and kill all the enemies.'
 */
fun deleteCharacter(string: String, char: Char): String {

    var updatedString = ""
    for (ch in string) {
        if (ch != char) {
            updatedString += ch
        }
    }
    return updatedString
}