Jump to content

Help getting characters at a certain position in a string.


Recommended Posts

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. :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...