Strings are immutable. There is no API to do this. You can construct a new string object by doing s[1:1]*"b"*s[3:end].
On Tue, Dec 22, 2015 at 4:06 PM, Dongning Guo <[email protected]> wrote: > Simple question: How to change the character at a specific position of a > string? Searched for a while in vain. Thanks. > > > For example: > > *julia> **s=^("a",4)* > > *"aaaa"* > How to change the second character to *'**b'*, that is to change s to: > > *"abaa"* > > > > >
