acadia acadia - 6 months ago 46 Question

Last but one Char in 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


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();