Sign in to follow this  
Followers 0
HeXetic

Get numbers from a string

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



Are they all in the format of:

IT Manual ##

If so, then just use a stringtrimleft function, strip the whitespace if you need. If you want it to be changed from a string to a number, use the number() function.

Share this post


Link to post
Share on other sites

Yeah they are all in the format of IT Manual ## so stringtrimleft should work just fine. Thanks very much.

Share this post


Link to post
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)

Share this post


Link to post
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
Sign in to follow this  
Followers 0