How can I remove a certain string
on a StringBuilder
? Ex. .append("Stack over flow dot com")
Remove flow
and .toString()
is now equal to Stack over dot com
. I want to try .remove()
but it only accepts (startIndex, length)
. Do I have to search for the string first in the StringBuilder
and store index and length to be used for .remove(i,x)
? If possible, is there a better way to do it?
Dim someStrBlr As New StringBuilder
Dim someStrRmv = "flow"
Dim someString = "Stack over flow dot com"
someStrBlr.append(someString)
someStrBlr.remove(?) 'remove? "flow"
someStrBlr.remove(?) 'replace? "flow" with ""
Console.WriteLine(someStrBlr.toString()) "Stack over dot com"