if there is any string in a given format like as "company
name employeecode date" then we have to fetch employeecode
form string
for ex-string is "capgemini12345june2013" then we have to
fetch 12345 by using vb script so guys how can we do that
please reply it.

Answer Posted / suman

Str = "capgemini12345une2013"
Dim i, j
For i = 1 to Len(Str)
If isnumeric(Mid(Str, i, 1)) Then
Exit For
End If
Next
MsgBox i

For j = i to Len(Str)
If not isnumeric(Mid(Str, j, 1)) Then
Exit For
End If
Next
MsgBox j
MsgBox Mid(Str, i, (j - i))

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of procedures are available in the vbscript language?

532


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

1792


Explain about arrays in vb script?

604


How are values assigned to the variables in the vbscript language?

571


What are the properties of regexp object?

581






What is the output of a + b in vbscript if a = 5 and b = 10?

2106


how to increase the values in text box in a given text box increament by two values by clicking on button

1641


Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?

2589


What is the difference between a dictionary and an array?

578


Is VB Script Case sensitive or Case insensitive?

636


When to use function procedures and what are its characteristics?

550


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

2161


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

2574


If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?

1556


What are the naming conventions while declaring a variable in the vbscript language?

618