Sign in to follow this  
Followers 0
mdwerne

A more compact way to write this line?

3 posts in this topic

Hello,

How might I write this line without using all the OR's? Seems like there is a more compact way to do this with a loop, just not sure what it is. :huh2:

ElseIf StringInStr($Version, "v1.3.1_04") <> 0 Or StringInStr($Version, "v1.3.1_05") <> 0 Or StringInStr($Version, "v1.3.1_06") <> 0 Or StringInStr($Version, "v1.3.1_07") <> 0 Or StringInStr($Version, "v1.3.1_08") <> 0 Or StringInStr($Version, "v1.3.1_09") <> 0 Or StringInStr($Version, "v1.3.1_10") <> 0 Or StringInStr($Version, "v1.3.1_11") <> 0 Or StringInStr($Version, "v1.3.1_12") <> 0 Or StringInStr($Version, "v1.3.1_13") <> 0 Or StringInStr($Version, "v1.3.1_14") <> 0 Or StringInStr($Version, "v1.3.1_15") <> 0 Or StringInStr($Version, "v1.3.1_16") <> 0 Or StringInStr($Version, "v1.3.1_17") <> 0 Or StringInStr($Version, "v1.3.1_18") <> 0 Or StringInStr($Version, "v1.3.1_19") <> 0 Or StringInStr($Version, "v1.3.1_20") <> 0 Then

Thanks,

-Mike

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try a RegEx...

If StringRegExp($Version, "v1\.3\.1_(0[4-9]|1[0-9]|20)") Then

Just need to figure out the perfect regex if the above is unsatisfactory :huh2:

Edited by MrMitchell

Share this post


Link to post
Share on other sites

Try a RegEx...

If StringRegExp($Version, "v1\.3\.1_(0[4-9]|1[0-9]|20)") Then

Just need to figure out the perfect regex if the above is unsatisfactory :huh2:

Seems to work perfectly! Nothing unsatisfactory about it... ;)

Thank you,

-Mike

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