strings as arrays (New Features)

by Jim ⌂ @, Russell, KY, Thursday, March 06, 2014, 03:39 (1115 days ago) @ koscianski

How cool is that. I never would have thought of the empty string as a delimiter. :)

I have written a little demo program that shows the extra "" element at the beginning and ending of the exploded array.

a$ = "abcd1234"
print a$
letters$ = explode(a$,"")
for t = 0 to letters$[?]-1
print t + " " + letters$[t]
next t
b$ = implode(letters$,"")
print b$
print b$ = a$

outputs

abcd1234
0
1 a
2 b
3 c
4 d
5 1
6 2
7 3
8 4
9
abcd1234
1


Complete thread:

 RSS Feed of thread

powered by my little forum