How to remove the last comma from the end of string in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim s As String = "c,c++,c#,python,vb,"

        If s.EndsWith(","c) Then
            s = s.TrimEnd(","c)
        End If

        Console.Write(s)
    End Sub
End Class




' run:
'
' c,c++,c#,python,vb
'

 



answered Apr 12, 2022 by avibootz

Related questions

1 answer 159 views
1 answer 143 views
1 answer 147 views
1 answer 134 views
1 answer 189 views
1 answer 146 views
1 answer 149 views
...