acadia acadia - 3 months ago 11
Vb.net Question

Last but one Char in vb.net String

How do I find last but one character in a vbstring

for e.g. In the string V1245-12V0 I want to return V

Answer

If you want to get the last alpha-character in a string you could use a LINQ query such as (C#):

var d = from c in myString.ToCharArray().Reverse()
                where Char.IsLetter(c)
                select c;
return d.First();