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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / sriraja
str="capgemini12345june2016"
strsplit=split(str,"june")
convstr=cstr(strsplit(0))
for i=1 to len(convstr)
strmid=mid(convstr,i,1)
if isnumeric(strmid)=true Then
temp=temp&strmid
End if
Next
Print temp
Is This Answer Correct ? | 0 Yes | 0 No |
how to write code: to check whether the window of an Application Under Test exist or not . plz give with example
write generic functions for webapplication?like generic function for webedit generic function for webbutton generic function for links
Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?
Write a program to print all lines that contains a word either “testing” or “qtp”
Which in-built function is used to format the number in the vbscript language?
Can u describe what kind of testing are for OTC derivates by banks.
what does create object actually do when you call it in vbscript?
What is the use of the recordset object and which statement is used to create such an object?
how to retrive the tooltip by using descriptive programming in qtp?
What are the environments supported by vbscript language?
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
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