Larry Bates <larry.bates at websafe.com> writes: > IMHO the most elegant method is something like: > > def switchchar(srcstring, position, character): > b=list(srcstring) > b[2]=character > return ''.join(b) If the strings or large or you're doing it a lot, the array module is likely more efficient.