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

A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.

1504


How to add actions in driver script to run those actions in QTP?

1516


What is difference between vbscript and vba?

606


How to Import data from a file (file is on the desktop) to the data table

1577


Which operator can be used to do an xor operation in vbscript?

676






write a program to display configuration of a local system with the help of vb script.

1684


What are the properties of regexp object?

579


What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?

575


Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder

1567


What is the difference between javascript and vbscript?

532


How will you get the natural logarithm of the given number in vbscript?

601


if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.

1440


What are lbound and ubound in the vbscript language?

602


What is the difference between function and procedure?

567


Which function is used to perform string comparison?

559