------
## 最终结论
```python
def replace_char(string, old_char, new_char):
    return string.replace(old_char, new_char)

# Test cases
assert replace_char("polygon",'y','l')==("pollgon")
assert replace_char("character",'c','a')==("aharaater")
assert replace_char("python",'l','a')==("python")
```