Import std.text.layout
std.text.layout
std.text.layout: a String's lines laid out again. WordWrap fills lines up to a width in a terminal's columns, Dedent takes away the indentation every line has, and Indent puts a prefix before each line. A line ends at "\n", "\r\n", or "\r", and each keeps its line break.
std/text/layout.fb
Functions
Levenshtein
function
Public Function Levenshtein(a: String, b: String): Int
How many single-character edits, inserting, deleting, or changing a character, turn a into
b, counting characters, code points.
Extends
String
extend
Extend String
No doc comment.
-
Its lines filled with words up to
widthcolumns each, as a terminal shows them, with DisplayWidth and a tab going on to the next multiple of 8 columns: each line breaks before the word that would go past it, at the spaces before that word, which go, while the spaces between words that stay on a line stay as they are. A no-break space, U+00A0, U+2007, or U+202F, is part of its word, not a place to break. A line's leading whitespace starts each line it becomes, and a word wider than the rest of thewidthis broken between its grapheme clusters. Panics whenwidthis below 1. -
A copy without the leading spaces and tabs that each line that isn't blank starts with, all alike, as when text is written indented in code. A blank line becomes empty.
-
A copy with
prefixbefore each line that isn't blank.
Report an issue with this page or with FutureBlitz on GitHub.