stringedits

The stringedits package contains the Edit trait & associated iterators for simple edits of strings

This is primarially a library crate for the project spellcheck_toy

Usage

Add stringedit = "0.1.3" under [dependencies] in your Cargo.toml, then bring the Edit trait into scope.

rust use stringedit::Edit; let replaces = "ab".replaces().collect::<Vec<String>>().join(" "); let want = concat!( "ab bb cb db eb fb gb hb ib jb kb lb mb nb ob pb qb rb sb tb ub vb wb xb yb zb ", // replace first character, 'a' "aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az", // replace second character, 'b' ); assert_eq!(want, replaces);

Author

Written by Efron Licht (efron.python@gmail.com)

License

Available under the MIT License