How can I find out whether a word in a string is existed or
not
for example
"QTP IS A POWERFULL TOOL FOR AUTOMATION"
How can i find out whether "powerfull" is existed in the
above string or not
Could anyone answer it?
Answer Posted / nithya.m
Create a filesystem object . Read the file till the
letter "P" comes . After that Read till the length of the
word which you want to Check (In this case it is 9). then
compare the word with the word which you want to check
which should have been stored already . If the
stringcompare is true means, the word exists. Please go
through the following code for this example
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("FILENAME" ,1)
Str="Powerfull"
Str1=objReadFile.ReadAll()
Set objReadFile_new = objFSO.OpenTextFile("FILENAME" ,1)
For i = 1 to len(Str1)
Str2=objReadFile_new.Read(i)
if Str2=Left(Str,1) then
Str3=ObjReadFile_new.Read(len(Str))
if Str3=Str then
Msgbox "FileExist"
Exit For
End if
Next
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What is throw Object?
What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?
what is vmodel?advantages and disadvantages of vmodel?
can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?
i have an external excel datasheet where it only contains 3 rows. after qtp executed the code to import the datasheet, the datatable getrowcount method now gives me a different value, lets say 60,000+ instead of only 3. i did not have any values starting from row 4 of my excel file. why is this happening? this also results to the qtp report to load for a very long time.
What is the difference between a Function and Procedure in QTP?
How software tester can use constants and variables in scripts?
Define Environment Variable in UFT and its uses?
How we can import data from database?
What is the Command used to start the QTP
What do you mean by iteration?
How to find array size in qtp?
why should we give deliver good quality software?
hi guys, pls tell me for testing institution training hub, hitech city is best or not?
How to add object to object repository in qtp9.0 Suppose for brower yahoo home page