Brian Carbone
12/04/2019, 6:54 PMBurkhard
12/04/2019, 7:04 PMStringBuilder
instead.
val sb = StringBuilder()
sb.add(orig.substring(0, rng0.start)
sb.add(repl[0])
sb.add(orig.substring(rng0.end + 1, rng1.start)
// etc
Just check my ranges, I might have a few off by one errors in there. I don’t remember when start/end are inclusive or exclusive.
Also the ranges can’t overlap but you can just modify themBrian Carbone
12/04/2019, 8:24 PM