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
Explain the tristate constants in vbscript?
Explain about operator precedence in vb script?
What if you do not specify anything when you call a procedure?
How to add actions in driver script to run those actions in QTP?
Explain about adodb.stream class?
What are the different types of operators and their order of precedence?
can anyone tell me the procedure of interview held in applabs
Explain the support of asp for vb script functionality?
Explain the operator precedence in vb script?
Explain the asc function?
Explain sga memory structures?
Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).
How to take whole text output from screen of Bitmap Application.
How to Convert Hex color code to color name in VB Script?
What are lbound and ubound in the vbscript language?