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 242 views
3 answers 297 views
2 answers 240 views
1 answer 187 views
3 answers 285 views
2 answers 214 views
...