Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Escape special char sequence in string
#4
This works...

Function Function16
Code:
Copy      Help
str outform
if(!inp(outform "" "" "[]")) ret
ARRAY(str) a=outform
int i
for(i 0 a.len)
,_s.format("out [34]%s = _s[34] %s" a[i] a[i])
,_s.findreplace("_" "%")
,out _s

I'm not sure why .format doesn't just let [37] be a % without using it as part of the function...it caught me up for a bit. Find replace will do the trick...you can use more complicated combinations of characters to make sure it replaces what it is supposed to.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)