Jump to content

Recommended Posts

Posted

Hello,

Lets say I have this string "oasis;fueldump;radar;railgun;goldrush;battery"

Now I need to get the first word in this string. (oasis).

The string could be anything, depending on what the users inserts.

I tried something like

$String = "oasis;fueldump;radar;railgun;goldrush;battery"
$FirstMap = StringSplit($String, ";")
$FirstMapEx = $FirstMap[0]

MsgBox(0, "", $FirstMapEx)

But its not my day :P

AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Posted

In your case $FirstMap[0] is the number of element the string was partitioned into. I think you want the first element, [1].

Indeed and $FirstMap[0] is the total number of elements which is why you get msgbox 6

so you can use while $var <= $firstmap[0] to use all the map names

What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

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
×
×
  • Create New...