I need to replace the first substring in a string with a new string.
For example:
import string
message = 'First part' + ';' + 'Second part'
m='101.0.0.1'
message[0]=str.replace (message[0],message[0],m)
print (message)
I want to get an answer of "101.0.0.1;Second part"
but I am getting the following error:
'str' object does not support item assignment.
Can anybody help me? How I can get an answer like "101.0.0.1; Second part"?