I think this thread already covers the issue pretty thoroughly.

s = string(s[1:2], "A", s[4:end])


Note that using "string" as a variable name is not advised since it's a
function name.

On Mon, Oct 6, 2014 at 4:01 AM, JVaz <joanvazquezmol...@gmail.com> wrote:

> Hello, I am new in Julia and it's the first time I publish here, but I
> actually would find it useful to modify a string. For example, I want to do:
>
> string = "ACTGACTG"
> string[3] = A    --> (error)
>
> And I cannot use replace because I don't wanna change all the T, I just
> wanna change the third character in the string.
> For me, it is useful that they are trings because then "after a mutation"
> I can easily check if two strings are the same, e.g:
>
> How could I do that, then?
> Thanks
>

Reply via email to