How to split a string at every 10th position and add to array

@thima
give a try on following:

Assign activity
left side arrSplits (DataType: String())
right side:
Enumerable.Range(0,CInt(Math.Ceiling(strText.Length / 10))).Select(Function (x) New String(strText.Skip(x*10).Take(10).toarray)).toArray

with the redundant use of the segmentsize (10) we suggest to use it within a variable:
VarName: SegementSize, Default Value: 10 DataType: Int32

Variable strText = YourTextString

so the statement changes to:
Enumerable.Range(0,CInt(Math.Ceiling(strText.Length / SegmentSize))).Select(Function (x) New String(strText.Skip(x*SegmentSize).Take(SegmentSize).toarray)).toArray

3 Likes