Needed this for my program, maybe it will be of some use to others, too:
Use it like this:
The example outputs the following:
B4X:
Sub Implode(glue As String, pieces() As String)
Dim result As StringBuilder
If pieces.Length = 0 Then Return ""
If pieces.Length = 1 Then Return pieces(0)
result.Initialize
result.Append(pieces(0))
For i=1 To pieces.Length-1
result.Append(glue & pieces(i))
Next
Return result.ToString
End Sub
Use it like this:
B4X:
Dim S() As String = Array As String("A", "B", "C")
Log(Implode("|", S))
B4X:
A|B|C