This method will also help you: https://www.w3schools.com/python/ref_string_replace.asp code example
Example: python replace
string = "[Message]"
string = string.replace("[", "")#Removes all [
string = string.replace("]", "")#Removes all ]
print(string)