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

Dim str,arr
str = "i love india"
strlen = len(str)
ReDim arr(strlen)
For i = strlen to 1 step -1
arr(i) = mid(str,i,1)
x = x & arr(i)
Next
msgbox x

Is This Answer Correct ?    10 Yes 5 No

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

Answer / rupesh

Hi Karthik,
ur script will reverse the string but not the individual
words...

output of ur script will be "aindi evol i"

Is This Answer Correct ?    6 Yes 1 No

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

Answer / nivas

The below given is perfect script for this Query.

Dim str
str = "i love india"
arr = split(str, " ")

for i=lbound(arr) to ubound(arr)
revStr = strreverse(arr(i))
fStr = fStr & revStr & " "
next

msgbox fStr

Is This Answer Correct ?    5 Yes 0 No

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

Answer / janardhan

Given sting
String str="i love india";
String s[]=str.split();
for(int i=str.length();i>0;i--)
System.out.println(s[i]);

Is This Answer Correct ?    5 Yes 2 No

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

Answer / praveen ponnala

hi guys

Try this

Dim MyStr, MyArray

MyStr = "I Love India"
MyArray = Split(MyStr," ")

msgbox StrReverse(MyArray (0)) &" " &StrReverse(MyArray
(1)) &" "&StrReverse(MyArray (2))

Is This Answer Correct ?    3 Yes 2 No

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

Answer / rajender singh

aa = "i love india"
bb = split(aa," ")
dd = ""
For i=0 to ubound(bb)
cc = StrReverse(bb(i))
dd = dd&" "&cc
Next

msgbox dd

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

Dim str,arr
str = "i love india"

m=split(str," ")

For k=lbound(m) to ubound(m)
mystr=m(k)

strlen = len(mystr)
ReDim arr(strlen)
For i = strlen to 1 step -1
arr(i) = mid(mystr,i,1)

x = x & arr(i)

Next
x=x&" "
Next
msgbox x

Is This Answer Correct ?    0 Yes 0 No

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

Answer / k.chalapathirao

i cheched it , but 8it is not reverse, plz chech it once

Is This Answer Correct ?    0 Yes 0 No

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

Answer / ramesh

Str="I Love india"
arr1=split(Str," ")
for i=0 to ubound(arr1)
arr=arr1(i)
lenarr=len(arr)
if lenarr=1 then
sing=sing&arr&" "
End if
if lenarr<> 1 then
for j=lenarr to 1 step-1
val=mid(arr,j,1)
rev=rev&val&" "
next
end if
rev=rev&" "
next
msgbox sing&rev

Is This Answer Correct ?    0 Yes 0 No

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

Answer / lak

Reverse a string without using String Functons
(mid,split,len..)

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 0 No

Post New Answer

More QTP Interview Questions

When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

0 Answers  


How you can delete excel file in qtp?

0 Answers  


What is the main difference between desriptive programming and generic functions

2 Answers   HCL,


How to get the particular property value?

0 Answers  


Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?

0 Answers  






Explain the new feature of UFT regarding the export of test results?

0 Answers  


in howmany ways you perfrom batchtesting

6 Answers   Lehman Brothers,


suppose we recording a web based project so for that we are using internet explorer after that if we execute that script in netscape then script will execute or not and one more thing is to exeute the script in any browser what to do

2 Answers   DigiTech,


How the automated tests in org

1 Answers   Maintec,


what is review

0 Answers  


plz can any one send me what is Automation Testing Frameworks.. Thanks in advance

1 Answers  


how to upload an excel sheet to quality center?

1 Answers  


Categories