Link to home
Start Free TrialLog in
Avatar of SETP
SETP

asked on

Extracting a number

I need to write a subroutine in VB.NET 2003 which extracts numbers from a string (they will always be nonnegative integers). It must only extract numbers at the end of the string.

Examples:
=======

abc123 -> 123
123abc456 -> 456
123abc456def789 -> 789
123 -> 123
123abc -> nothing
abc123d -> nothing
abc -> nothing

Is there anything built into VB.NET 2003 that can do that? If not, can anyone show me the best way of implementing this subroutine?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SETP
SETP

ASKER

Thanks guys