Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 943 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 943 Bytes

Provides extension methods to split strings on Word boundaries, according to the Unicode Standard Annex #29 rules. Grapheme Cluster support should come soon.

Features

Word iteration

var input = "The quick (“brown”) fox can’t jump 32.3 feet, right?";
var result = new List<string>();
foreach (var word in input.EnumerateWords())
    result.Add(word.ToString());
// This code iterates over words in the specified string and produces:
// The|quick|brown|fox|can’t|jump|32.3|feet|right

Word boundary iteration

var input = "The quick (“brown”) fox can’t jump 32.3 feet, right?";
var result = new List<string>();
foreach (var word in input.EnumerateWordBoundaries())
    result.Add(word.ToString());
// This code iterates over words in the specified string and produces:
// The| |quick| |(|“|brown|”|)| |fox| |can’t| |jump| |32.3| |feet|,| |right|?