Jump to content
Sign in to follow this  
=sinister=

Determining Amount Of Strings Split

Recommended Posts

Just like the title says, how would I determine the amount of strings split in the function StringSplit.

Example:

In

$days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",")

How many commas are there.

Share this post


Link to post
Share on other sites

I feel dumb, read that part wrong.... was thinking that [0] was the first string, and so on... Thanks.

Just be careful not to get StringSplit() and StringRegExp() confused.

StringSplit() returns an array where [0] holds the number of elements. If you used StringRegExp() then [0] would be the first element, so you would have to use UBound($array) - 1 to give you the total number of elements (Personally I just got in the habbit for using that with everything).


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

k thanks for the tip, I have another question.

How can you read a certain line in GUICtrlCreateEdit using GUICtrlRead?

Have an example of what you are talking about? Could be as easy as StringSplit(StringStripCR(GUICtrlRead($varedit)), @LF)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Ok, 1 more question until I get off yalls nerve, how about getting the line count to a GUICtrlEdit?

I tried:

$Test = UBound(GUICtrlRead($TestEdit))
    MsgBox(0, "Test", $Test)

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  

×
×
  • Create New...