how to reverse a string with out using string or predefined
function,ex:string is " i love india". the output should be
like this "i evol aidni"

Answers were Sorted based on User's Feedback



how to reverse a string with out using string or predefined function,ex:string is " i love ind..

Answer / mogal

str=" i love india"

StrSpl = Split(str," ")

For j = 0 to Ubound(StrSpl)

result1 = result1 & " " & ReverseStr1(StrSpl(j))
Next

msgbox result1

Function ReverseStr1(Str1)
For i = 1 to Len(Str1)
ReverseStr1 = mid(Str1,i,1) & ReverseStr1
Next
End Function

Is This Answer Correct ?    1 Yes 0 No

how to reverse a string with out using string or predefined function,ex:string is " i love ind..

Answer / lak

str=" i love india"

Set regExpObj=new RegExp
regExpObj.pattern="[a-z A-Z]"
regExpObj.global=true

Set matches=regExpObj.execute(str)
For each letter in matches
result=letter.value&result
Next

msgbox result

Is This Answer Correct ?    0 Yes 1 No

how to reverse a string with out using string or predefined function,ex:string is " i love ind..

Answer / siva

You can use StrReverse syntax

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

How can you send user defined messages to test report?

0 Answers  


QTP is identifying all windows application objects(i.e. winbutton,winconbobox,etc) as winobjects.How to handle this? Is there any way to add our own properties to identify objects?

1 Answers  


In a QTP project lets say there are 100+ function library and incorrectly we have duplicate some function in multiple libraries. How to find those duplicate functions and remove them?

1 Answers  


how to retrive that the number of spaces are in a string ????

2 Answers   Liquid Hub,


I AM NEW IN QTP,PLZ TELL ME ANY BOOKS FOR QTP, MY COMPANY IS QTP,SO I LEARN QTP,PLZ ANYBUDY HELP ME

68 Answers   AZTEC,






How should i get name of the screen? Ex:There is a "submit" button.If i clicked on the submit button it opens a screen. I want that screen name.How can i get that screen name I dont have any property regarding that screen. If suppose we cliked on the screen , Then QTP captures the screen properties then i can get the screen name by using GETROPROPERTY But i want the screen name without clicking the screen. ("I am using the "settoproperty" for Second screen by using fist screen properties") Please tell me anyone

3 Answers   Livetek,


How many types of recording modes in qtp? Which will be used when?

0 Answers  


In qtp, how you can use xpath to identify objects?

0 Answers  


What is standalone database?

0 Answers  


What does SPLIT and JOIN commands do in Vbscript?

6 Answers   Ordain Solutions, UBC,


How to get line numbers in your editor in expert view?

2 Answers  


Hi Friends, I worked with 8.2 not with 9.2. Please help me in this prob. I created one script and recorded some think and save as Test 1 then I opened process--open the object repository manager. Switch to file->save->give some name->save as Objectrepo1.tsr file. (This is the global repository file.) Then I went to object repository->tools-> associate repository ->click + icon ->open the previously saved Objectrepo1.tsr file. This is the global repository Now I created one more script and save as Test 2. In this script I am calling script with the Help of "Call of existing action" and I executed but QTP is not able to execute B’cos it is QTP is not able to read the Object Repository of Test 1. Please let me know why? Once I made Script 1 as a shared Obj. Repository so it would not give any Problem. Right?

0 Answers   Cap Gemini,


Categories