C# Class Crisis.StringFormatter.OptimalWordWrappedString

Class performing an "optimal solution" word wrapping creating a somewhat more estetically pleasing layout.

This is based on the "optimal solution" as described on the Wikipedia page for "Word Wrap" (http://en.wikipedia.org/wiki/Word_wrap). The drawback of this method compared to the simple "greedy" technique is that this is much, much slower. However for short strings to print as console messages this will not be a problem, but using it in a WYSIWYG word processor is probably not a very good idea.

Afficher le fichier Open project: teeknofil/Crisis-Wordlist-Generator

Méthodes publiques

Méthode Description
OptimalWordWrappedString ( string s, int lineWidth ) : System
ToString ( ) : string

Private Methods

Méthode Description
BuildWordList ( string s, int lineWidth ) : void
FindLastOptimalBreak ( int j ) : LineBreakResult
GetCost ( int i, int j ) : int
GetWords ( int i, int j ) : string
SumWidths ( int i, int j ) : int

Method Details

OptimalWordWrappedString() public méthode

public OptimalWordWrappedString ( string s, int lineWidth ) : System
s string
lineWidth int
Résultat System

ToString() public méthode

public ToString ( ) : string
Résultat string