I want to extract the numbers from the string

This question is not answered

I want to extract the numbers from the string
e.g., 123Arpit ...so what i want the output as 123
Can anyone please help me how to do it.  Thank you

All Replies
  • you have several options, the most obvious is strKeep(inputString, '0123456789')

  • But it is not fixed like i have various numbers

    e.g., 101arpit

    10arpit

    1023arpit

  • strKeep keeps only the characters that you want to keep

    strKeep('101arpit','0123456789') returns '101'

    strKeep('1023arpit','0123456789') returns '1023'

  • You can use strKeep function to dissolve alphabets. It always returns string value where in which you can convert to integer.

    Eg: strKeep("123Arpit567","0123456789") // returns "123567"

  • Thank  you very much guys.