How to remove the spaces in a string Ex: "Welcome to
QTPWorld" ?

Answers were Sorted based on User's Feedback



How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / vinay

Str = Welcome to QTP World
Replace(Str," ","")


Result= WelcometoQTPWorld

Is This Answer Correct ?    27 Yes 0 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / krishna

Str="Quick Test Pro"
R=Replace(Str," ","")
msgbox R

Is This Answer Correct ?    10 Yes 0 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / vasudha

Dim str
str="welcome to qtp"

arr=split(str," ")
For i=0 to Ubound(arr)
abc=abc&arr(i)

Next
print abc

Is This Answer Correct ?    10 Yes 3 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / mithuna reddy

Dim str,arrsplit,arrjoin

str = "Welcome to QTP World"
arrsplit = Split(str," ")
arrjoin = Join(arrsplit,"")
MsgBox arrjoin

Is This Answer Correct ?    5 Yes 0 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / lak

Mahe answer is will work only traling and leading the
spaces from a string.But middle spaces can not be removed
from a string.

agree with vinay ,vasudha

Is This Answer Correct ?    3 Yes 0 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / ranni

Trim function will not work,it cannot remove spaces in between words

Is This Answer Correct ?    2 Yes 1 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / sowjanya

Msgbox Replace("wellcome to qtp world"," ","")

OR

str= "Wellcome to qtp world"

arr=Split(str," ")

for i=0 to Ubound(arr)

abc=abc&arr(i)

next

msgbox abc

Is This Answer Correct ?    1 Yes 0 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / vishnu

Str = "Welcome to QTPWorld"
Sp1=Split(str)
For i=0 to ubound(Sp1)
temp=temp&Sp1(i)
Next
print temp

Is This Answer Correct ?    1 Yes 1 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / mahe

Using with trim() Method

Is This Answer Correct ?    2 Yes 14 No

How to remove the spaces in a string Ex: "Welcome to QTPWorld" ?..

Answer / mahesh

Ex::

X="Welcome to QTP World"

Y=trim(X)
Msgbox Y

O/p::WelcometoQTPWorld

Is This Answer Correct ?    4 Yes 29 No

Post New Answer

More VB Script Interview Questions

i have developed the below QTP script to count the no of items available in the web list "Select a product" in www.bankrate.com and also want to print what are the items??? can any one help me to rectify the below script??? SystemUtil.Run "iexplore.exe","www.bankrate.com" a=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetTOProperty("items count") msgbox a Dim List() ReDim List(a-1) For i = 1 To a List(i-1)=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page ("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetItem(i) Print List(i-1) Next

1 Answers  


Is it possible to pass optional argument to function in vb script?

2 Answers  


How to replace junk code recorded by QTP with a mall function.

0 Answers  


How to get the background color of a weblist?

3 Answers   Accenture,


what is diff between static and dynaic arrys?

0 Answers  






What is select case statement?

0 Answers  


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

0 Answers  


what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?

4 Answers   Perot Systems,


Which operator is used to perform the comparison among 2 operands in the vbscript language?

0 Answers  


we executed QTP scripts in one browser(i.e IN)same scripts is working on another browsers or not (i.e mean netscap,m azol..like )

6 Answers   Accenture,


How to assign a date value to a variable?

0 Answers  


how to automatically update the sql server2005 database records when insert in vb6?

0 Answers  


Categories