Hello dear friends.
I Need your support:
I have this code: GLAGAC512BOEFOG"
I need to extract the three numbers and the three letters before: GAC512
Please advice how to do it:
Also would be great if you show me how to generate an array of all these codes from the datatable.
I also dont understand the format of this record:
Its so annyoing.
Yoichi
(Yoichi)
February 18, 2022, 9:51am
3
Hi,
How about the following expression?
System.Text.RegularExpressions.Regex.Match(yourString,"\D{3}\d{3}(?=\D|$)").Value
Regards,
1 Like
Works Perfectly.
Can you show me please how to generate an array of all these codes from the datatable column, or should i go with a for each loop and add to the array one by one ?
Thank you Yoichi
Yoichi
(Yoichi)
February 18, 2022, 9:59am
5
Hi,
Can you try the following LINQ expression?
arrString = ExtractDataTable.AsEnumerable.Select(Function(r) System.Text.RegularExpressions.Regex.Match(r(1).ToString,"\D{3}\d{3}(?=\D|$)").Value).ToArray
Hope this helps you.
Regards,
2 Likes
Yoichi
(Yoichi)
February 18, 2022, 10:15am
7
Hi,
Oh, sorry. r(1)
should be r("Flight")
Regards,
1 Like
system
(system)
Closed
February 21, 2022, 10:16am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.