a;;b;c;;;d in this string output is abcd will come how can we
do that in vbscript in QTP testing?

Answers were Sorted based on User's Feedback



a;;b;c;;;d in this string output is abcd will come how can we do that in vbscript in QTP testing?..

Answer / eswar

s = "a;;b;c;;;d"
For i=1 to len(s)
x = Mid(s,i,1)
If x <> ";" Then
y=y&x
End If
Next
MsgBox y

Is This Answer Correct ?    2 Yes 0 No

a;;b;c;;;d in this string output is abcd will come how can we do that in vbscript in QTP testing?..

Answer / sadashiva @ wipro

str="a;;b;c;;;d"
a=len(str)
for i=1 to a
b=replace(str,";","")
next
msgbox b

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More VB Script Interview Questions

how to find greatest of n numbers!

3 Answers   Syscon,


How will you trim the spaces on the left of a string using vbscript?

1 Answers  


Hi Friends, I am facing some issues with If,else condition,i.e. i am working on some web page for ex:gmail page.now if i want to check if username is incorrect or already exist,i want to display error message in my test report,for this i am using a simple code first,i.e. If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "Shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If But still i am getting a syntax error If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If I don't feel any thing wrong in this syntax but i don't understand why it shows such error,i am confused what went wrong,please help me out & do the favor,thanks a lot....

1 Answers  


Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.

0 Answers   CSC,


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

0 Answers  






What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?

0 Answers  


A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.

0 Answers  


How you can call vbscript functions?

0 Answers  


Hellow friends, I am learning QTP,but here problem is VB script. please guide me how to learn VB script w.r.t QTP and if you know any books tell me or if you have any materials or any use full material or any else w.r.t QTP please post me p.p.sekhar

0 Answers  


When are redim statement and preserve keyword used in the vbscript language?

0 Answers  


Out of the different type of operators, which are evaluated first and last in the vbscript language?

0 Answers  


Explain the difference between POST and GET Method.

1 Answers  


Categories