Recognition of first character of string is alphabet or numerical

Hi everyone,

Can anyone pls suggest some solution for below question?

I have a data in the excel with the column A, where the values may start with alphabets or numerical.
How to check the starting character is alphabet or numerical

For example
Column A
AS0123
45689

If it starts with alphabet i need to enter the data in text field, if its a number the we need to enter in exam Regno field

Please le me know if anyone has solution.

Regards,
PK

1 Like

find some initial samples:
grafik

2 Likes

@ppr Can you please share the sequence

Another apporach is to work with Regex and group names:

grafik
grafik

where we can formulate following:

new Regex("(?<isDigit>^\d)|(?<isLetter>^[A-Za-z])").Match("1234").Groups.Cast(Of Group).Skip(1).Where(Function (g) g.Success).Select(Function (g).Name).toArray

same within the Query syntax

arrValidation =

(From g in new Regex("(?<isDigit>^\d)|(?<isLetter>^[A-Za-z])").Match("1234").Groups.Cast(Of Group).Skip(1)
Where  g.Success
Select n = g.Name).toArray

which can be optimized and dynamized by using variables

was done within the immediate panel:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

Hello.

You can use the function “first()”, “IsNumeric()”, “IsLetter” or “IsDigit”.

Example:

Char.IsDigit(“text”.First())

The result is always true or false.

Hug

1 Like

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