Would be nice is $mid was extended to become this
$mid
original $mid(text,S,N)
Returns N characters starting at position S in text.
$mid(othello,3,4) returns hell
If N is zero, it returns the number of characters from S to the end of the line.
You may also use negative numbers for S or N.
or
newstuff $mid(text,S,N,newtext)
Returns text with N characters starting at position S in text replaced with newtext
$mid(SampleWordsHere,7,4,Textz) returns SampleTextHere
If N is zero no text is replaced
* The below bits a fiddly but could be worked out.
maybe if if N is negitive it takes it from the right of newtext, but inserts it the right way
N is greater than len of newtext, ummm newtext repeats? or extras N values ignored or extra characters removed, I dont know i could live with any of them
might be some other things to think about
This was a functionality of the MID function right back in old BASIC days, dont see that it would effect anything here as currently a 4th parameter well cause
* Invalid parameters: $mid
so any new usage wouldnt cross the old stuff.