Is it possible to use wildcards in string?

i have string input = “OH–onsite”
where OH is fixed
“–onsite” willl vary
can i use wildcard here?

Hi,

you could use the LIKE operator with wildcards:
SampleBoolean = SampleString LIKE "OH*"

or check with the String.StartsWith method:
SampleBoolean = SampleString.StartsWith("OH")

Your requirement is kind of unclear though. Does this help?

Hi

If you are passing this string to a selector then wildcard will work

Or if you are using it in a Regex expression then wildcard will work again

If it is passed for another string then it won’t
Instead use a variables like this

“OH-“+str_variable

That would work for sure
Where we can pass the value we want in that string variable

Cheers @anishakotian400

1 Like

i have path “\xxx\xxxx\xxxxxxx\xxx\xxxx\TAX FORMS\OH – need to update” in sharepath

i need to open that path uisng “\xxx\xxxx\xxxxxxx\xxx\xxxx\TAX FORMS\OH”

am i clear now?

Pls check this thread

There are n number of approaches used with wildcard in an expression

Cheers @anishakotian400