Is your feature request related to a problem or challenge?
current substr() implementation uses owned string to create StringArrays, which causes lots of memory fragment and slows down the execution.
Describe the solution you'd like
use StringBuilder to avoid creating owned strings.
Describe alternatives you've considered
No response
Additional context
No response