In this article, we will be covering Replacing a char acter in string with another char acter in Python
In Python, we can replace a char acter in a string with replace method. Below is the example code to replace I letters in hello world string with space char acter.
# replace a char acter in a string with another char acter
var2 = var1.replace("l", " ", 5)
print(var2)
Above string declarations in Python are all valid to create a string variable. Later on, we can call that variables for further use with printf to display in bash shell.