trim last "," delimiter of a string in vb.net
Posted
by gerfe
on Stack Overflow
See other posts from Stack Overflow
or by gerfe
Published on 2010-04-27T19:44:32Z
Indexed on
2010/04/27
20:23 UTC
Read the original article
Hit count: 296
this is my code -
With ad.Tables(2)
For i As Integer = 0 To .Rows.Count - 1
If .Rows(i)("name") & "" <> "" Then
temp &= .Rows(i)("name") & ", "
End If
Next
End With
temp = temp.Trim(",")
testing &= "&Name=" & temp & vbCrLf
with this is get a comma in the end of the string. but if i do this
temp = temp.Trim.Trim(",")
all commas are deleted. How do i keep all commas and only delete the last one?
© Stack Overflow or respective owner