Jump to content

Get array item


xAx
 Share

Recommended Posts

Hi

How can I get an item from the string below when I only have the separator character and the number of the item?

$string = "item1#item2#item3#item4#item5#"

For example I want to get the third item.

Thanks

Abduljabbar

Link to comment
Share on other sites

Read up on StringSplit and Arrays

#Include <Array.au3>; Only Required for _ArrayDisplay

$string = "item1#item2#item3#item4#item5#"
$aString = StringSplit($string, "#")

$ThirdItem = $aString[3]

_ArrayDisplay($aString, "$aString Array")

Hi

How can I get an item from the string below when I only have the separator character and the number of the item?

$string = "item1#item2#item3#item4#item5#"

For example I want to get the third item.

Thanks

Abduljabbar

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