private List <List <char> > GetSplitedMatrixByColumn(string text) { StringBuilder sb = new StringBuilder(text); var matrixSize = Convert.ToInt32(Math.Round(Math.Sqrt(text.Length))); var _initialMatrix = new List <List <char> >(); for (int i = 0; i < matrixSize; i++) { _initialMatrix.Add(new List <char>()); foreach (var item in sb.ToString().Take(matrixSize)) { if (item == ' ') { _initialMatrix[i].Add(_delimiter); } else { _initialMatrix[i].Add(item); } } sb.Remove(0, sb.Length > matrixSize ? matrixSize : sb.Length); _initialMatrix[i].AddRange(_indexHelper.Fill(_delimiter, matrixSize - _initialMatrix[i].Count())); } return(_initialMatrix); }