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 238 views
3 answers 285 views
2 answers 233 views
1 answer 181 views
3 answers 276 views
2 answers 206 views
...