Posts: 30
Threads: 2
Joined: May 2011
Reputation:
0
05-30-2011, 01:28 PM
Hi,
I have a string with spaces example
Full name="Anand Kumar Dave"
i want to remove the spaces and store in another variable as
"AnandKumarDave" how can we do this ??
There is list of names and i have to remove spaces from all the names.
some names are having only one space in between and some have two spaces.
Posts: 91
Threads: 19
Joined: May 2011
Reputation:
0
05-30-2011, 01:48 PM
hi
try with this syntax
sVal = Replace("Sathiya Arunachalam"," ","") ' A binary comparison starting at the beginning of the string. Returns "SathiyaArunachalam"
Posts: 30
Threads: 2
Joined: May 2011
Reputation:
0
05-30-2011, 03:05 PM
Thanks Suresh the replace function works fine. It removes all the spaces.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
07-15-2013, 03:16 PM
Why would we need to re-invent the wheel when Vbscript has provided a ready-made solution for your needs ? ;-)
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 57
Threads: 13
Joined: Feb 2014
Reputation:
0
02-19-2014, 06:54 PM
(This post was last modified: 02-19-2014, 06:55 PM by venkatesh9032.)
Hi anand,,
You can use Trim function..
Dim str
Str=" Quick test professional"
Msgbox Str------->First run this and comment
Temp=Trim(Str)
Msgbox Temp------>Second run this
You will get it
Posts: 1
Threads: 0
Joined: Aug 2019
Reputation:
0
08-12-2019, 04:47 PM
Dim str
str=" Quick test professional"
x=Split(str," ")
For i=1 To UBound(x) Step 1
y = y&x(i)
Next
MsgBox y