MID$ Function (New Features)

by Jim ⌂ @, Russell, KY, Monday, October 08, 2012, 01:01 (1896 days ago) @ lrcvs

Here is a "replaceat" function using the new 0.9.9.x functionality of functions.

a$ = "this is a string"
print repaceat$(a$,6,2,"was")
end

function replaceat$(str$,start, len, new$)
replaceat$ = ""
if start>1 then replaceat$ = mid(str$,1,start-1)
replaceat$ = replaceat$ + new$
if len > 0 then replaceat$ = replaceat$ + mid(str$,start+len,99999)
end function


Complete thread:

 RSS Feed of thread

powered by my little forum