Replace Character

Easy

📝 Description

Replace all occurrences of a character in a string

Input Format

String, old character, new character

Output Format

Modified string

Constraints

1 ≤ string.length ≤ 1000

🔍 Sample Input

"hello"
"l"
"x"
            

✅ Sample Output

"hexxo"
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run