[Solved] Replace Function – vb.net [closed]


don’n know exactly what do you want but below 2 code snippets can help you:

1.just use Replace:

'remove tab characters
Dim outString as String = inString.Replace(Constants.vbTab, "")

or

'remove spacec haracters
Dim outString as String = inString.Replace(" ", "")

2.use an Split then use Replace in a loop through resulted array by Split:

'split with tabs(or spaces) or spaces
Dim arrayStr() As String = inString.Split(Constants.vbTab)
'remove space(or tabs) characters
For i As Integer = 0 To arrayStr.Length - 1
 arrayStr(i) = arrayStr(i).Replace(" ", "")
Next

3

solved Replace Function – vb.net [closed]