在foxpro中有一个函数只从字符串或变量中提取数字吗?

Bla*_*Tie 0 foxpro

在foxpro中有一个函数只从字符串或变量中提取数字吗?到目前为止还没找到?

Fra*_*rez 6

您可以包装CHRTRAN函数并将结果放在一行代码中.例如:

* This can contain numbers, characters, special characters, etc.
m.lcSource = "ABC.1def23-gHI45J!#6KL"

* This is what I want returned back to me.  In this case, it's digits only.
m.lcReturnToMe = "0123456789"

* The inner CHRTRAN() function removes anything that is a number.  The return value is
* what will be removed in the outer CHRTRAN function.
m.lcDigitsOnly = CHRTRAN(m.lcSource, CHRTRAN(m.lcSource, m.lcReturnToMe, SPACE(0)), SPACE(0))