Jump to content
Sign in to follow this  
marscom

Help getting characters at a certain position in a string.

Recommended Posts

marscom

Okay, problem I have been having and can't seem to fix.

Im scripting in autoit and I have a string that looks like this

$string1= 10010100

Basically I need to reverse the string and later do other things with it, the easiest way to do this would to be able to get the value at a specified position in the string eg get it so that $value3 would equal 0 and $value6 would equal 1

Just as Im typing this it occured to me, would it be better to use an array with 8 single digit values and call the specified value from the array

E.g

$array[0] = 1

$array[1] = 0

$position2 = $array[1]

Suggestions?

Thanks very much in advance for any help. :)

Share this post


Link to post
Share on other sites
marscom

StringMid

Edit: By the way... welcome to the forum.

Your a star, thanks very much! :)

And thanks for the warm welcome aswell ^^

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.