I want to reverse a set of words in a string.
for eg i have a string as "AS - ALORSTAR" I want to reverse the string and print as "ALORSTAR - AS" .
Can i do this without using a split function and concatenating the variables. is there any built in vb function
You can try something like this
<font class="small">Code:</font><hr /><pre>
x = "AS - ALORSTART"
y = Split(x, " ")
for i = LBound(y) to UBound(y)
z(i) = y(UBound(y) - i)
Msgbox Join(z, " ")
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **
Sorry, but this is a very specialized need. Not something that comes as part of QTP or VBS out-of-the-box. You're going to have to write your own function to do it.
Tarun's code is very nice and quite concise for what you need.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"
x = InputBox ("Enter the Stringto reverse?")
For i = 1 to Len(x)
a(i-1) = Mid(x,i,1)
b(j) = a(i-1)
madhuqtp, Your code is just another version of VBScript internal StrReverse function. And for sure not a better one