acadia acadia - 1 year ago 139 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

Answer Source

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();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download