In Python, strings are immutable.
What is the standard idiom to walk through a string character-by-character and modify it?
The only methods I can think of are some genuinely stanky hacks related to joining against a result string.
--
In C:
for(int i = 0; i < strlen(s); i++){ s[i] = F(s[i]);}
This is super expressive and says exactly what I am doing. That is what I am looking for.
replace
for this? – Aug 12 '10 at 2:43