Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Letters and Symbols from String

Status
Not open for further replies.

MrTBC

Technical User
Nov 19, 2003
610
US
I have a field containing strings which consist of a mixture of numbers, letters, symbols, and spaces. There is no pattern to this. I need to remove all characters except the numbers from each one.
e.g. 0171 R321119 (A)
(M)/ 0116 6777745BB
These need to be turned into:
0171321119
01166777745

Any ideas gratefully received.
 
Try this formula:

stringvar test:= "a1b23,)*4(m)5";
stringVar x := "";
numbervar i;
for i := 1 to len(test) do
if isnumeric(Mid (test, i, 1)) then
x := x + Mid (test, i, 1);

x;

-dave
 
Thank you very much - that's great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top