Jump to content
Sign in to follow this  

Reading between the lines? (Substrings)

Recommended Posts


Ok this time I'm wondering if theres a simple way to get strings seperated by either commas or |'s. I have no idea what thats called, anyways...

I have it set so I can just use the position + length but I have to do that eight times for 16 variables which can be a pain.

Example of the string I need to seperate into eight parts: "1.00,1.50,2.00,0.75,2.00,0.35,0.50,0.05"

Now I know I can do that one that finds the occurance of a comma, then mix that with the position and length one.. but that would still be very anoying.

Share this post

Link to post
Share on other sites

Try this:

Local $String = "1.00,1.50,2.00,0.75,2.00,0.35,0.50,0.05"
Local $Split = StringSplit($String, ',')
Local $Output
For $i = 1 To $Split[0]
    $Output = $OutPut & $Split[$i] & @LF
MsgBox(0, 'Test', StringTrimRight($Output, 1))

Edit: Put in StringTrimRight to get rid of the last @LF

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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.