PHP/Python Replace first string in a line with another string -


i'm trying replace first ":" "space" , don't have clue on how it! maybe guys can me.

in text:

ab:cd:ef:gh:ij:kl:mn 12:ab:c2:f3 303:mx: dk:ad:y4:d3 12:31:44:ac:210 sda: 

the output :

ab cd:ef:gh:ij:kl:mn 12 ab:c2:f3 303:mx: dk ad:y4:d3 12 31:44:ac:210 sda: 

maybe me out.

thanks in advance

in python,

a = 'ab:cd:ef:gh:ij:kl:mn' = a.replace(':', ' ', 1) 

yields

ab cd:ef:gh:ij:kl:mn 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -