I need a value between two characters in a string.The values are between { and }. Sometimes there may be more then 1 occurrence.
var = split("this {is} a {test}","{")
var = split("this {is} a {test}","}")
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t believe that splitting the string would be a solution since you need to know the position of the character that is splitting your string.
So I’m giving you two solutions
Solution #1
Regular Expression
First of all, you’ll need to add the reference to VBA Regular Expression.
Tool -> References & Microsoft VBScript Regular Expression 5.5Code
Solution #2
Linear Search
Code