Uipath expressions

Good day,
Does anyone know what expression or function is used to determine that a number or variable begins with a consecutive one?
Example determine which numbers start with “111”

Thank you

@Mike99,

You can use substring. Example: myVariable.Substring(1,3)
This will give me the first 3 characters of the String. So, basically then use after that a IF to determine if that substring = “111”.

Public Function Substring (startIndex As Integer, length As Integer) As String
https://docs.microsoft.com/en-us/dotnet/api/system.string.substring?view=netframework-4.8#System_String_Substring_System_Int32_System_Int32_

hi @Mike99,

You can simply use this condition in If activity —> no1.ToString.StartsWith(“111”)
and by putting MessageBox in Then & Else accordingly (“Yes”, “No” resp.) you’ll get to the output.

@Mike99 When you say begins with Consecutive , the Example should be something like “123” isn’t it ? :sweat_smile: