mishutkin
12 years agoOccasional Contributor
Problem with a single quotation mark in a string
Can't find a description of this problem anywhere...
I have a script written in VBScript. I am trying to see if a string contains a substring that has a single quotation mark in it:
String = "Let's bring it up later"
Substring = "Let's bring"
Res = aqString.Find(String, Substring)
Why I am getting -1, meaning that the string does not contain the substring? If I reduce the substring to "s bring" than I get a positive result. Looks like the apostrophe (single quote) has something to do with it... But why does it? Single quotes are allowed in VBScript strings.
I have a script written in VBScript. I am trying to see if a string contains a substring that has a single quotation mark in it:
String = "Let's bring it up later"
Substring = "Let's bring"
Res = aqString.Find(String, Substring)
Why I am getting -1, meaning that the string does not contain the substring? If I reduce the substring to "s bring" than I get a positive result. Looks like the apostrophe (single quote) has something to do with it... But why does it? Single quotes are allowed in VBScript strings.