Sign in to follow this  
Followers 0
Rad

Reading between the lines? (Substrings)

3 posts in this topic

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



#2 ·  Posted (edited)

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
Next
MsgBox(0, 'Test', StringTrimRight($Output, 1))

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

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

Ahh ty ty! Sounds exactly like what I needed :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  
Followers 0