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
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Answer / k.chalapathirao
i cheched it , but 8it is not reverse, plz chech it once
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
Hello, I am learning QTP. I have recorded test for Login page, i have also inserted checkpoint for Email field & when I run test it passed. But when i tried to run test by inserting 'Adding Parameter Values to a Data Table' for email & password field, it pass the first value in both the fields but after that when test run for second parameter values it displays 'Internet Explorer cannot open the Internet site, Operation aborted' & when i analyze test result it displays run time error 'Object disable'. I have also cleared all the history from IE but it is not working. Please help me. Thank you.
Define QTP ?
How can we disable popup blocker? (I think it means when we get a pop up messge(its error) how we wil disable that one with out interrupting normal process)
How to open any application during Scripting in QTP?
can somebody send the script to write a multiplication table in notepad through qtp
tell me abt a time when u had to go above &beyind the call of duty to get the job done
Count the number of radio buttons and randomly select one.
I am having trouble understanding #1 how to paramaterize a userid and password that I need to call in about 25 existing scripts. I need to know how to Create a Reuseable action for 25 existing scripts that will call the exact same userid and password? I need to know how to create a Reuseable action and then have it called by existing scripts being run in a batch.
Why we are selecting QTP for testing ?
How to compare the two strings?
where did you automate in your project?(please tell me example senarios)
what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?