Jump to content

Get numbers from a string


Recommended Posts

Hopefully there is a quick an easy solution to this but I couldn't see any solution in the help file.

Basically I want to get the integers values out of a string. For example I have the string "IT Manual 18" but I jut want to get the number 18 from it.

Thanks in advance.

Link to comment
Share on other sites

My Solution. I am just learning RegExp, so one of the more experienced users might have a better solution... :)

CODE
$string = "It Manual # 18"

$ret = StringRegExpReplace ($string, "[^0-9]", "")

MsgBox (0, "", $ret)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...