Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Returns 0-based index of token
#3
if(empty(s1)) ret -1
can be removed because gett returns -1 when there are no more tokens

Code:
Copy      Help
function# $s $target

for int'i 0 1000000000
,if(_s.gett(s -i)<0) ret -1;; Not found
,if(_s=target) ret i;; 0-based index of token

With ARRAY also OK.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)