I have string like hp company.print tis like company hp.write a program in vbscripting

Answer Posted / jp mumbai

Hi,

We can write a code in 2 ways. one is Generic Code and another is Hard Code.

In Generic Code:

Str="hp company"
ArrayStr=Split(Str)

For i = uBound(ArrayStr) to 0 Step-1
expStr=expStr &" "& ArrayStr(i)
Next

msgbox expStr

-------------------------------------------------

In Hard Code:

Str="hp company"
ArrayStr=Split(Str)

expStr= ArrayStr(1)&" "&ArrayStr(0)

msgbox expStr

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How strcomp function works?

835


how to check whether link is disabled in QTP??

5815


What is the difference between vbscript and vba?

807


regular expression that will recognize a browser as long as its name property starts with mybrowser

1957


Write a vbscript procedure that converts feet to inches. Hint: there are 12 inches in a foot?

793


Which operator is used to concatenate the 2 values in the vbscript language?

767


how to set one column as primary key in QTP and fetch values accordingly

2050


Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?

1738


How will you convert a given number to long in vbscript?

657


How will you get a string with the specified character the specified number of times in vbscript?

770


Why is it recommended to close the database connection every time after the work is completed?

695


By default in vbscript the arguments passed to functions and subroutines are by reference or by value?

823


How to make sure that items in a wintree are sorted al?

2555


Which function allows you to instantiate an object given its programmatic identifier or progid?

781


How can you create a file object to work with the files in the vbscript language?

702