add doc string
This commit is contained in:
parent
1d7c36bd8c
commit
13defcc9f6
1 changed files with 4 additions and 0 deletions
|
|
@ -3,6 +3,10 @@ import unicode
|
||||||
proc wordWrap*(s: string, maxLineWidth = 80,
|
proc wordWrap*(s: string, maxLineWidth = 80,
|
||||||
splitLongWords = true,
|
splitLongWords = true,
|
||||||
newLine = "\n"): string =
|
newLine = "\n"): string =
|
||||||
|
## This function breaks all words that reach over `maxLineWidth`
|
||||||
|
## measured in number of runes. When `splitLongWords` is `true`
|
||||||
|
## words that are longer than `maxLineWidth` are splitted. Multiple spaces and newlines are converted to a single space. All
|
||||||
|
## whitespace is treated equally. Non-breaking whitespace is ignored.
|
||||||
|
|
||||||
var currentWordLength: int = 0
|
var currentWordLength: int = 0
|
||||||
var currentWord: string = newStringOfCap(32)
|
var currentWord: string = newStringOfCap(32)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue