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
ppr
(Peter Preuss)
June 21, 2022, 3:06pm
2
praveenchintu374:
AS0123
find some initial samples:
2 Likes
@ppr Can you please share the sequence
ppr
(Peter Preuss)
June 21, 2022, 3:26pm
4
Another apporach is to work with Regex and group names:
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
ppr
(Peter Preuss)
June 21, 2022, 3:27pm
5
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
system
(system)
Closed
June 28, 2022, 11:16am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.