How to check if the Captured string starts with
E, F, H, I (Except I410 or I413) , L, M, P, R, T, V
Logic 1 : If text starts with above letters then we need to assign value to the variable as YES
Logic 2 : If text starts with I410,I413 and other letters then we need to assign value to the variable as NO
rlgandu
(Rajyalakshmi Gandu)
August 4, 2023, 2:18pm
2
Take Else if:
Input_Str.StartsWith(“E”)or Input_Str.StartsWith(“F”)…
Assign:Value=Yes
Else if:
Input_Str.StartsWith(“1410”)or Input_Str.StartsWith(“1413”)
Assign:Value=No
Else
Value=No
Hi @Sathish_Kumar_S ,
You can try
StartsWith (Text, Fragment)
eg: * StartsWith("Blueberry”, "blue")
: True
then assign value
Regards,
LNV
ppr
(Peter Preuss)
August 4, 2023, 3:01pm
4
Ensure the following:
Dynamize it with variables
Getting below error. Can you share the above regex command here?
Variable type is Regex and value is Regex.IsMatch(MaterialGroup.Replace(“I410”,^(I410I413)“,”—“),”")
ppr
(Peter Preuss)
August 5, 2023, 12:02am
6
do not miss to quote the strings properly with double quotes
Thanks … now i am getting below error
ppr
(Peter Preuss)
August 5, 2023, 1:13am
8
dynamize it with variables
Parvathy
(PS Parvathy)
August 5, 2023, 2:54am
9
Hi @Sathish_Kumar_S
Use Else If acitivity and give below condition:
text.StartsWith("E") Or text.StartsWith("F") Or text.StartsWith("H") Or text.StartsWith("L") Or text.StartsWith("M") Or text.StartsWith("P") Or text.StartsWith("R") Or text.StartsWith("T") Or text.StartsWith("V")
Then
result="YES"
ElseIf
text.StartsWith("I410") Or text.StartsWith("I413")
Then
result="NO"
Else
result="NO"
Hope it helps!!
Anil_G
(Anil Gorthi)
August 5, 2023, 4:09am
10
@Sathish_Kumar_S
You can try this as well
{"E","F", "H","I" , "L", "M", "P", "R", "T", "V"}.Any(function(x) str.StartsWith(x)) AndAlso Not {"I410","I430"}.Any(function(x) str.StartsWith(x))
Cheers