Check if string start with any element from range

Hello!

I have a string of type str = “123456789”
I want to find out if this string starts with any number from range 100…200.

str = “123456789”
100,101,102,103,…123,…200

The result should be true, str is starting with 123 and this is in the interval 100-200
Is this possible with LINQ or Select?

Thank you!

Hi @Andrei_Croitoru

What do you mean by this. Can you give some examples of a pass and fail?

str = “123456789”
100,101,102,103,…123,…200

The result should be true, str is starting with 123 and this is in the interval 100-200

Hello

Take a look at this Regex Pattern.

You could this Regex Pattern with an Regex.IsMatch which will give a TRUE or FALSE outcome.

Try this.
Left Assign:
Boolean_Variable
Right Assign:
system.text.RegularExpressions.Regex.ismatch(INSERTstringINPUT, INSERTregexPATTERN)

Hopefully this helps :blush:

Cheers

@Andrei_Croitoru

  1. Let’s say str = “123456789”

  2. And then try below condition in IF activity.

      Cint(str.Substring(0,3)) > 100 AND Cint(str.Substring(0,3)) < 200

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.