Write a program to reverse the words of a given string.

88 views
Skip to first unread message

salmaan mohammad

unread,
Nov 18, 2018, 5:32:30 AM11/18/18
to QTP - HP Quick Test Professional - Automated Software Testing
string reverse(we want our words order to reversed rather than each character) like "Hello Dear" output should be like "olleH raeD"   without strreverse function

Keshav K

unread,
Nov 18, 2018, 5:45:59 AM11/18/18
to mercu...@googlegroups.com
i think we can use the same logic as we use for reversing a string without using strreverse function. We just have to take the words of string into an array and reverse each string and then concatenate each content of array.
Hope this solves your issue.
Regards

On Sun, Nov 18, 2018, 4:02 PM salmaan mohammad <sall...@gmail.com> wrote:
string reverse(we want our words order to reversed rather than each character) like "Hello Dear" output should be like "olleH raeD"   without strreverse function

--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

salmaan mohammad

unread,
Nov 19, 2018, 1:48:44 AM11/19/18
to mercu...@googlegroups.com
Can I get the code for that

uma mahesh

unread,
Nov 19, 2018, 2:26:26 AM11/19/18
to mercu...@googlegroups.com
Below is the code

Str = "Hello Dear"

arrStr =Split(Str, " ")

for i=0 to ubound(arrStr)
vartemp = ""
for j = 1 to len(arrStr(i))
vartemp = mid(arrStr(i), j, 1) & vartemp
Next
varOpt = varOpt &" "& vartemp
Next


MsgBox varOpt

Imran Khan

unread,
Nov 19, 2018, 2:26:26 AM11/19/18
to mercu...@googlegroups.com
Hey,

Check yourself and get it done. This is to help people when they have tried a lot to clear an issue. But that couldn't happen. Not for all the silly thing.

Thanks,
Imran.
Reply all
Reply to author
Forward
0 new messages