Jump to content

Checking index 2 of string.


netherknight

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 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...