I\'d like to break apart a String by a certain length variable. It needs to bounds check so as not explode when the last section of string is not as long as or longer th
private string[] SplitByLength(string s, int d) { List stringList = new List(); if (s.Length <= d) stringList.Add(s); else { int x = 0; for (; (x + d) < s.Length; x += d) { stringList.Add(s.Substring(x, d)); } stringList.Add(s.Substring(x)); } return stringList.ToArray(); }