Q:

Treat last element differently when concatenating strings

I made a loop for concatenating strings: 
For cz As Integer = 0 To length - 1 Step +1
    result += GetChar(a, index) + " * 2^" & length - 1 & " + "
    index += 1
    length -= 1
Next cz

Is it possible to not add the "+" on the loop's last step?
I want to use some operations on that result but when i have "+" as last char I can't.

A:

String.Join will accomplish that for you if you pass it an enumerable of strings:
Dim result = String.Join(" + ",
    a.Select(Function (c, i) c & " * 2^" & (a.Length - 1 - i)))

