Jump to content
Sign in to follow this  
agubler

Loop through string value

Recommended Posts

agubler

hi all

need a bit of help!! really would like a neat function to loop through a string and retrieve values seperated by a value (i.e. comma)

example string "one,two,three,four,five,six,seven,eight,nine,ten"

Would like the results to be return something like this

one

two

three

four

five

six

seven

eight

nine

ten

Many Thanks in advance! :P

Share this post


Link to post
Share on other sites
Mobius

$a = StringSplit("one,two,three",",")
FOR $i = 1 TO $a[0]
    ConsoleWrite($a[$i] & @LF) 
NEXT

Share this post


Link to post
Share on other sites
agubler

$a = StringSplit("one,two,three",",")
FOR $i = 1 TO $a[0]
    ConsoleWrite($a[$i] & @LF) 
NEXT
god i'm embarrassed it was that easy, was having a mental block! thanks alot for the quick reply :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.