How to remove the leading and trailing commas from a string in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
    Public Shared Sub Main(ByVal args As String())
		Dim str As String = ",,,,VB.NET,,"
		
        str = str.Trim(","c)
		
        Console.WriteLine(str)
    End Sub
End Class


' run:
'
' VB.NET
'  

 



answered Mar 6, 2025 by avibootz

Related questions

1 answer 143 views
3 answers 145 views
2 answers 121 views
1 answer 101 views
3 answers 134 views
2 answers 102 views
...