Tips and tricks for .NET using ASP and VB code.

Join an array of any type into a delimited string of text

        Dim ObjectArray() As Object = {0, "One", 2.7, Math.PI}
        Dim StringArray() As String = Array.ConvertAll(ObjectArray, Function(ThisValue) ThisValue.ToString)
        Dim JoinedText As String = Join(StringArray, ", ")

No comments:

Post a Comment

Search This Blog