Mega Code Archive

 
Categories / VB.Net / Data Types
 

Removes all trailing occurrences of a set of characters

Module TrimEnd    Public Sub Main()       Dim sentence As String = "this is a test."       Dim charsToTrim() As Char = {","c, "."c, " "c}       Dim words() As String = sentence.Split()       For Each word As String In words          Console.WriteLine(word.TrimEnd(charsToTrim))       Next    End Sub End Module