Delete all spaces in a line

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 Furkan

+3
source share
4 answers

Use String.Replace ()

Dim s As String = " What is this"
s = s.Replace(" ", "")
+9
source

You can use String.Replace:

Dim str As String = " What is this"
str = str.Replace(" ", "")
+2
source

I used str=str.Replace(" ","")with great success.

However, str=str.Replace(" ","")in the past it did not work for me.

+2
source

Usage String.Replace:

Dim Test As String = "Hello Hi"
Test = Test.Replace(" ", String.Empty)
+1
source

Source: https://habr.com/ru/post/1773678/


All Articles