/**
 * The exercise is to replace a character at a specific index in a given string.
 *
 * @param string The original string.
 * @param index The index at which the character needs to be replaced.
 * @param newChar The new character to insert at the specified index.
 * @return The updated string with the replaced character.
 */
fun replaceCharInString(string: String, index: Int, newChar: Char): String {

    return string.substring(0, index) + newChar + string.substring(index + 1)
}
/**
 * The exercise is to replace a character at a specific index in a given string.
 *
 * @param string The original string.
 * @param index The index at which the character needs to be replaced.
 * @param newChar The new character to insert at the specified index.
 * @return The updated string with the replaced character.
 */
fun replaceCharInString(string: String, index: Int, newChar: Char): String {
/**
 * The exercise is to replace a character at a specific index in a given string.
 *
 * @param string The original string.
 * @param index The index at which the character needs to be replaced.
 * @param newChar The new character to insert at the specified index.
 * @return The updated string with the replaced character.
 */
fun replaceCharInString(string: String, index: Int, newChar: Char): String {

    return string.substring(0, index) + newChar + string.substring(index + 1)
}