C# 클래스 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.

파일 보기 프로젝트 열기: teeknofil/Crisis-Wordlist-Generator

공개 메소드들

메소드 설명
OptimalWordWrappedString ( string s, int lineWidth ) : System
ToString ( ) : string

비공개 메소드들

메소드 설명
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

메소드 상세

OptimalWordWrappedString() 공개 메소드

public OptimalWordWrappedString ( string s, int lineWidth ) : System
s string
lineWidth int
리턴 System

ToString() 공개 메소드

public ToString ( ) : string
리턴 string