Silktest Question 7 : Matching '?' character in a string

How to use MatchStr function to actually look for the '?' character vs. it's default wildcard meaning?

Use the following code:

[-] main ()
[ ] STRING s = "this is a test?"
[ ] Print (MatchStr ("*{Chr(63)}", s))

1 comment:

Anonymous said...

The code provided should match to any string with at least 1 character. It will not check that the question mark is in the string. I believe you would need to use a combination of MatchStr and GetField in a recursive function.

SilkTest interview questions for QA Testers