How to capture the first letter in a not-repeating string ?

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 10 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
hackoo
Posts: 103
Last visit: Tue Apr 26, 2016 9:02 am

How to capture the first letter in a not-repeating string ?

Post by hackoo »

Hi ;)
I want to create a function for capturing the first letter in a not-repeating string
For example if have this :
MyString = "aabbccddMffrryx"
So the first letter will be retuned as M
So i'm looking for the best and the easy way to do it in vbscript.
So i ask you how can i do this function (Method)
Thank you !
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to capture the first letter in a not-repeating strin

Post by jvierra »

You would use RegEx to do this.

Start here for a tutorial on this subject: http://www.regular-expressions.info/
This topic is 10 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked