someString[someRandomIdx] = 'g';
will give me an error.
How do I achieve the above?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If it is of type
stringthen you can’t do that because strings are immutable – they cannot be changed once they are set.To achieve what you desire, you can use a
StringBuilderUpdate
Why use a
string, instead of aStringBuilder? For lots of reasons. Here are some I can think of: