예제 #1
0
        public void testCreateLines()
        {
            var worte      = new[] { "1", "22", "333", "55555" };
            var lineLength = 5;

            string[] result = WordWrap.CreateLines(worte, lineLength);
            result.Should().BeEquivalentTo("1 22", "333", "55555");
        }
예제 #2
0
 static void Main(string[] args)
 {
     // http://www.personal.uni-jena.de/~dps/advent.html
     string[] lines = WordWrap.CreateLines("Es blaut die Nacht,die Sternlein blinken,Schneeflöcklein leis hernieder sinken.".Split(' '), 14);
     foreach (string line in lines)
     {
         Console.WriteLine(line);
     }
     Console.ReadLine();
 }