I have a string and I want to replace a part of it.
The tricky part is that that I can’t use Regex.replace, because I only know the start and end positions of the data in the string.
For example, if the string looks like this:
I love cats, some more stuff here, we dont know how much more
And I have start=8 and end=11. And I want to replace that part to whatever I need to. This time lets say dogs so the new string will look like:
I love dogs, some more stuff here, we dont know how much more
How I could do that?
Simplest way:
I had expected
StringBuilderto have something which would do this, but I think you’d have to callRemovethenInsert.