StoryTeller.ConsoleWriter.BreakIntoLines C# (CSharp) Method

BreakIntoLines() private static method

private static BreakIntoLines ( int indent, string input ) : string[]
indent int
input string
return string[]
        private static string[] BreakIntoLines(int indent, string input)
        {
            if (string.IsNullOrEmpty(input)) return new string[0];

            var lines = new List<string>();


            while (input.Length > 0)
            {
                var width = _consoleWidth - indent;
                var chomp = input.Length > width ? width : input.Length;

                string c = new string(' ', indent) + input.Substring(0, chomp);

                lines.Add(c);
                input = input.Remove(0, chomp);
            }

            return lines.ToArray();
        }

Same methods

ConsoleWriter::BreakIntoLines ( string input ) : string[]