Jump to content

Any way of doing this?


McGod
 Share

Recommended Posts

Assign("s", "['0', '1', '2']")

#include <Array.au3>

_ArrayDisplay($s)

Something that can take literal ['0', '1', '2'] and convert it to an array.

Link to comment
Share on other sites

#include <Array.au3>

Dim $avArray

$avArray = _ArrayCreate("JPM", "Holger", "Jon", "Larry", "Jeremy", "Valik", "Cyberslug", "Nutster", "Tylo", "JdeB")

_ArrayDisplay( $avArray, "Array created with _ArrayCreate" )

Exit

from the HELP in AUTOIT !!!

Link to comment
Share on other sites

Even better?

#include <Array.au3>

Assign ("avArray", _ArrayCreate("JPM", "Holger", "Jon", "Larry", "Jeremy", "Valik", "Cyberslug", "Nutster", "Tylo", "JdeB"))

_ArrayDisplay( Eval ("avArray"), "Array created with _ArrayCreate" )
Link to comment
Share on other sites

No, you see I have a string

['0', '1', '2']

I want to convert it to an array

so string->array

So that I dont have to parse the [[ then manually loop it into an array.

Link to comment
Share on other sites

No, you see I have a string

['0', '1', '2']

I want to convert it to an array

so string->array

So that I dont have to parse the [[ then manually loop it into an array.

What is wrong with something like this?

I cannot see for my life why you would want to do this?

#include <Array.au3>
$text = StringReplace (StringReplace ("['0', '1', '2']", "['", ""), "']", "")
MsgBox (0, "", $text)
_ArrayDisplay (StringSplit ($text, "', '", 1))
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...