2 releases
0.1.1 | Apr 18, 2020 |
---|---|
0.1.0 | Apr 18, 2020 |
#825 in Command-line interface
Used in 2 crates
15KB
361 lines
Command-line string manipulation helpers.
This library provides string helpers for building command-line output. With this library, you can
- style string using ANSI codes,
- modify and transform strings with ANSI codes and Unicode characters.
Example
style_str("Hello", TextStyle::Bold)
Methods
style_str(txt, TextStyle);
color_str(txt, TextColor);
background_str(txt, TextBackground);
clean_str(txt);
match_indices(txt);
slice_str(txt, start, end);
size_str(txt);
pad_str(txt, width, TextAlign, chr);
trucate_str(txt, width, TextAlign, tail);
wrap_str(txt, width);
repaire_str(txt);
prepend_str(txt, chunk);
append_str(txt, chunk);
Dependencies
~3–4.5MB
~73K SLoC