linebreak

Implements the Unicode line breaking algorithm.

The algorithm supports line breaking rules for various languages.

Members

Functions

lineBreakRange
auto lineBreakRange(string text)

Creates a forward range of breakable text segments.

Structs

LineBreak
struct LineBreak
Undocumented in source.
LineBreakRange
struct LineBreakRange
Undocumented in source.

Examples

import std.algorithm : equal, map;

auto text = "Hello, world!\nThis is an English example.";
auto broken = text
	.lineBreakRange
	.map!(lb => lb.text);

assert(broken.equal(["Hello, ", "world!\n", "This ", "is ", "an ", "English ", "example."]));

Meta