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

1)How to test whether items in a weblist are in alphabetical order or not?

1 Answers   TCS,


Hi everybady, i have faced few Qns in one of i attended interview, please help me out with these below Qns. 1. how to join values without using join function? 2. how to compare values without using String compare function? 3. input is Bangalore, but i need output like this below format, what is function to use and get this outcome B A N G A L o R E 4. Input is "CapGemini" but uotput should be like this "inimeGpaC" 5. Input is 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 Can someone let me know results of this Qns, please. Thanks.

2 Answers   CSS Corp,


print the array values in ascending order?

2 Answers   CSS Corp,


Differentiate javascript and vbscript?

0 Answers  


Explain a few date functions in vbscript

0 Answers  






Inorder to avoid Message box while writing script which alternative method can be used?

1 Answers  


How do you declare a variable in vbscript?

0 Answers  


1. How to handle object implementation change in DP for Ex: i have login page with username,pasword (editboxes),login,cancel(buttons). Here i written DP code for login page with the help properties. My questions: 1.If properites are changing dynamically i will do (i want code for that) 2.if objects are changed dynamcally i will do (i wnat code for that)

0 Answers   iFlex,


What is the use of the recordset object and which statement is used to create such an object?

0 Answers  


Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

0 Answers  


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

0 Answers  


write a qtp script to count the number of minimized windows

1 Answers  


Categories