I have a string that's more than 160 characters and I want the string to be divided into parts of 160 characters. How can I achieve this with a for loop?
Dim message = "" /has 481 characters
If message.Length > 160 Then
Dim multiPartMessages As New ArrayList()
For i As Integer = 0 To message.Length - 1 Step 160
multiPartMessages.Add(message.Substring(i, 160))
//should add 4 arrays, 3 of them having 160 characters each and the fourth with just one
Next
Else
//code runs
End If