I want to get only the numbers from a string. For example I have something like this
just=\'Standard Price:20000\'
And I only want it to pr
I think bdev TJ's answer
price = int(filter(str.isdigit, just))
will only work in Python2, for Python3 (3.7 is what I checked) use:
price = int ( ''.join(filter(str.isdigit, just) ) )
Obviously and as stated before, this approach will only yield an integer containing all the digits 0-9 in sequence from an input string, nothing more.