local_strtools 0.1.1

Collection of string related utilities
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 2.25 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • javohir-abdusattorov

String tools

strtools is a collection of string related utilities, not provided by standart library. Especially useful when your project deals with lot of manipulations around String or &str

Pads a string with zeros, resulted string would be in length given in second argument

Examples

let str = String::from("9");
let padded_string = strtools::pad(str, 3);

assert_eq!(padded_string, "009");

Panics

When length of given string is bigger than the wanted to be length, program panics:

#[should_panic]
fn can_panic() {
   let str = String::from("98798");
   strtools::pad(str, 3);
}