diff options
author | Arne Döring <arne.doering@gmx.net> | 2018-11-08 09:46:12 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-11-08 20:52:22 +0100 |
commit | 13defcc9f6bd2e0f56a03e63d0d713d5f6b60d6d (patch) | |
tree | be49c6a63b0915993d8f1db90fa813cd15403470 /lib/std | |
parent | 1d7c36bd8cef74e85cbe9fd2a02a07555b46d0d2 (diff) | |
download | Nim-13defcc9f6bd2e0f56a03e63d0d713d5f6b60d6d.tar.gz |
add doc string
Diffstat (limited to 'lib/std')
-rw-r--r-- | lib/std/wordwrap.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/wordwrap.nim b/lib/std/wordwrap.nim index ff33a2ba9..3e3a4609c 100644 --- a/lib/std/wordwrap.nim +++ b/lib/std/wordwrap.nim @@ -3,6 +3,10 @@ import unicode proc wordWrap*(s: string, maxLineWidth = 80, splitLongWords = true, 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 currentWord: string = newStringOfCap(32) |