Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Return the last number of “Test”
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
This is another way
mid(test,11,len(test))
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Lorena,
one advise for you.You need to start exploring things in help documentation regularly.
mid is a very basic function in vbscript
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
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 ;-)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  regex works but how do i return the found string to a variable jove1776 2 3,415 08-24-2011, 06:17 PM
Last Post: jove1776

Forum Jump:


Users browsing this thread: 1 Guest(s)