Jump to content
Sign in to follow this  
netherknight

Checking index 2 of string.

Recommended Posts

Hi, 

Scripting is a little new to me, so hopefully this has an easy answer. 

I am looking to check a string for a certain number in a specific position. 
example variable: B1567

in the example's case I would like to check if the third character is 6. (in the example this is false and would return a 0)

I've been tinkering with strmatch: 
strmatch("**6**", "`chs('../ColorMaster/cl_master')`")

However, this checks if the string has a 6 anywhere in the string. resulting in a incorrect 1)

How can I adjust the strmatch to only check the third character? 

Any and all help would be appreciated!

With kind regards, 
Thomas 

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  

×