#string #helper #utilities #api-bindings

lngh_strings

Largenumbergoeshere's string utilities

2 unstable releases

0.2.0 Jun 9, 2023
0.1.0 Jun 8, 2023

#591 in #helper

MIT license

8KB
96 lines

LargeNumberGoesHere's string utilities

Just some small helper methods to make dealing with strings a little nicer. See docs for more detailed info!


lib.rs:

A small library with some convenient string helpers.

use lngh_strings::{WriteStringExt,WriteLnStringExt,WriteDebugStringExt,WriteLnDebugStringExt};

let pink = (255, 27, 141);
let yellow = (255, 218, 0);
let blue = (27, 179, 255);

let mut string = String::new();
string.writeln("hello world!")
    .writeln("The pan flag's colours are (in rgb):")
    .write("pink: ").writeln_debug(pink)
    .write("yellow: ").writeln_debug(yellow)
    .write("blue: ").write_debug(blue);

let expected =
r#"hello world!
The pan flag's colours are (in rgb):
pink: (255, 27, 141)
yellow: (255, 218, 0)
blue: (27, 179, 255)"#;
assert_eq!(expected, string);

No runtime deps