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



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

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

More VB Script Interview Questions

after medical test,when will be the police verification

0 Answers   IBM,


Mention how to access array data?

0 Answers  


Explain about constants in vb script?

0 Answers  


How will you get a random number between 0 and 1 in vbscript?

0 Answers  


how to declare a variable in vbscript using vbscript

4 Answers  






write a vb script to open a text file and write into it

2 Answers  


who will create the object?

0 Answers   TCS,


How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b) and i am addding those 2 and storing in to another var (c). Now i want to pass that var(c) to another function (fun2). What will be the script?

6 Answers   Nous,


Can anyone help me in write coding to get this pattern * ** *** ****

3 Answers  


hey please tell me how to retriev data from excel sheet which puts the login name and password in the application? plz send me the code..please help me

6 Answers   HP,


Write VB script to convert from feet to inches(hint 1feet=12 inches)

2 Answers  


Which function is used in the vbscript language to convert the specified expression into a date type value?

0 Answers  


Categories