Sign in to follow this  
Followers 0
AutoDoIt

StringSplit's flag, how 2 use?

3 posts in this topic

#1 ·  Posted (edited)

I know how 2 split a string with delimiters, but I just can't understand the purpose of the flag (parameter)!

What does the following stuffs means?

If flag is 0 (the default), then each character in the string will mark where to split the string. If flag is 1, then the entire delimiter string is needed to mark the split.

In the helpfile, there's a example:

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

They seems no difference :D

Can u guys give me a example that shows the difference (if they do have)? :">

Edited by AutoDoIt

Share this post


Link to post
Share on other sites



Try -

$days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",s",1)
MsgBox(0,"",$days[0]&$days[1]&$days[2])
$days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",s")
MsgBox(0,"",$days[0]&$days[1]&$days[2])

You should see the difference^^

Share this post


Link to post
Share on other sites

You should see the difference^^

Thanks, evilertoaster! :D

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  
Followers 0