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 / abhijit bongale
Option Explicit
Dim Str : Str = "capgemini12345june2013"
Dim i, j
For i = 1 to Len(Str)
If Asc(Mid(Str, i, 1)) >= 48 AND Asc(Mid
(Str, i, 1)) <= 57 Then
Exit For
End If
Next
MsgBox i
For j = i to Len(Str)
If (Asc(Mid(Str, j, 1)) >= 65 AND Asc(Mid
(Str, j, 1)) <= 90) OR (Asc(Mid(Str, j, 1)) >= 97 AND Asc
(Mid(Str, j, 1)) <= 122) Then
Exit For
End If
Next
MsgBox j
MsgBox Mid(Str, i, (j - i))
Set Str = Nothing
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What if you do not specify anything when you call a procedure?
What is the difference between for loop and while loop?
Which function is used to perform string comparison?
How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'
How will you convert a string to upper case string using vbscript?
what is the features of visual basic?
what is the difference between modular and data and keyword driven framework
How to Convert Hex color code to color name in VB Script?
wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......
How will you compare two strings in vbscript?
How will you format a number in percetage format in vbscript?
What methods are used to create text files and open text files in the vbscript language?
Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)
What is the main difference between function and sub-procedure?
How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...