Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



How can I find out whether a word in a string is existed or not for example "QTP IS A POWE..

Answer / anshu

I think u just need to use

INSTR() that's it.

Is This Answer Correct ?    12 Yes 1 No

How can I find out whether a word in a string is existed or not for example "QTP IS A POWE..

Answer / naina

C = "QTP IS A POWERFULL TOOL FOR AUTOMATION"
msgbox Instr(1,c,"POWERFULL")

The result will be 10 , which is the position of the first
occurrence of the string POWERFULL

Is This Answer Correct ?    7 Yes 1 No

How can I find out whether a word in a string is existed or not for example "QTP IS A POWE..

Answer / sunil

Dim str,word

word=inputbox("enter the word for search")
str=inputbox("Enter a Sentence")
if instr(1,str,"word") then
msgbox "Searching word is present in the sentence"
else
msgbox"Searching word is not present in the sentence"
end if

Is This Answer Correct ?    3 Yes 0 No

How can I find out whether a word in a string is existed or not for example "QTP IS A POWE..

Answer / suresh

you fool nithya... y ur using FSO....and 10 lines of code...

this is too bad,,,,,
must use Instr
that s it

Is This Answer Correct ?    4 Yes 1 No

How can I find out whether a word in a string is existed or not for example "QTP IS A POWE..

Answer / prasoona

s="QTP IS A POWERFULL TOOL FOR AUTOMATION"
ss="powerfull"
If Instr(1,s,ss,vbTextCompare)<> 0 Then
msgbox ss&" exist in " &s
Else
msgbox ss&" is not exist in " &s
End If

Is This Answer Correct ?    3 Yes 1 No

How can I find out whether a word in a string is existed or not for example "QTP IS A POWE..

Answer / akshar jain

just assign that entire string to a variable & use either
instr or strcomp thats it

Is This Answer Correct ?    0 Yes 2 No

How can I find out whether a word in a string is existed or not for example "QTP IS A POWE..

Answer / 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

More QTP Interview Questions

write a regular expression pattern for xyz?123?

1 Answers   FAI,


suppose take one row in a row 16 columns is there.in 16 columns 16 numbers is there.but i want to get each 3 column number.o/p :5 columns get in 16 columns means. so can anybody write this function? plz send if u know the answer.

2 Answers   Bosch,


is it possible to add sheets to excel at runtime

1 Answers  


What are software testing metrics

3 Answers  


Read excel using qtp descriptive programing

2 Answers   TCS,


What is the extention of Virtualobject

1 Answers   Accenture,


How will you test a keyboard?

0 Answers  


we have a link in a website or webtable How can we record link in that table or site? link is not static we don't know exact location of that link? how ? if u know pls give reply with script also?

6 Answers   Cognizant, Covansys,


How to handle dynamic objects in quicktest professional?

0 Answers  


Hi all , I am new at QTP I want a sample script to check validation messages(For java script or VB script) for login page with for web based application.. Any one can Help. I have to complete it in two days I need urgent help.. Ex. if I want to check mail.yahoo.com 1 > If user doed not exist it display "Username does not exist" 2> if invalid Uname and password then it display" Invalid Uname or pass" 3> Loing Sucssessfully. I want to check this types of application by using data table to give values of username and password.. Thanks

2 Answers  


how do i know how to use tools

0 Answers  


How you automate testscripts one by one or moduelwise or all at once

2 Answers  


Categories