Is there any function in vb.net that removes all spaces in a string. I mean a string like \' What is this\' should be \'Whatisthis\'
Thanks Furqan
Use String.Replace()
Dim s As String = " What is this"
s = s.Replace(" ", "")
You could use String.Replace:
Dim str As String = " What is this"
str = str.Replace(" ", "")
I have used str=str.Replace(" ","")
with great success.
However, str=str.Replace(" ","")
has not worked for me in the past.
Using String.Replace
:
Dim Test As String = "Hello Hi"
Test = Test.Replace(" ", String.Empty)