Micro Focus QTP (UFT) Forums

Full Version: Return the last number of “Test”
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I use RegEx to just return the last number of “Test”?

Code:
Test = "NestedGrid1" or Test = "NestedGrid15"

To return 1 or 15?

I did figure this out:
xNGNum = replace(Test, "NestedGrid","")
but i am curious if there is a better way.

thx
This is another way
mid(test,11,len(test))
Rajpes,

thx man ;-)

Can you please explain this? Should it not be mid but left? I thought mid goes from the middle?

It's ok, i will look this up again. thx
Lorena,
one advise for you.You need to start exploring things in help documentation regularly.
mid is a very basic function in vbscript
Rajpes.

Thx, but i did try to look this up. I do every time do a search. I even look online but most of the Forum sites from my work are blocked. For some reason, this site is not as of yet. I have found tons of help here, thx for your help.

Advise noted ;-)