linq - Vb.net condition last digit check -


rugroup containing this...

ma1,ma2,ma3,ma4,ma5,ma6,ma7,ma8,ma9

i've checked ma , length. how can check if 3rd digit number? cuz if value stored mas, need display that. please let me know how use endswith property or else in this..

getretailugrp = (from retailunitgrp in retailunits not (retailunitgrp.rugroupname.tostring.startswith("ma") , retailunitgrp.rugroupname.tostring.length = 3)).tolist() 

you can use char.isdigit:

dim invalids = rug in retailunits                 rug.rugroupname.length < 3 _                  orelse not rug.rugroupname.startswith("ma") _                  orelse not char.isdigit(rug.rugroupname(2)) 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -