#functions in python

2 messages · Page 1 of 1 (latest)

misty canyon
#

it looks messy and its not what i wanted to make

def replax(pos , char , text):
    return text[:pos] + char + text[(pos + 1):]

i wanted to do smth like text.replax( pos , char )
and i think to do that i gotta create text object first in order to use replax method ik im thinking so wrong but

text.replax( pos , char )

is that possible??

#

Strings are nontrivial messes