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
Which object provide information about a single runtime error in a vbscript?
How will you get the octal value of the given number in vbscript?
Mention what is vbscript?
Is vbscript a case-sensitive or case-insensitive?
Out of the different type of operators, which are evaluated first and last in the vbscript language?
can anyone send me a vb scripts code for clicking on a link and coming back on home page again does the same for many links on a web page.
give me any information abou vb script books learn quckly
Why is the use of exit do or exit for statements within loops discouraged?
How should i Create Email invite with server-side Coding?
Explain the tristate constants in vbscript?
Explain some uses of vb script?
How to create a function in vbscript?
Explain about vb script?
What is difference between vbscript and vba?
Hi this is Vinoth. I need a help on below mentioned question A combobox contains list of items assume as 5 I have to get each items Individually and I have to Export to datatable. Please help me on this. Thanks