1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! # 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);
/// }
/// ```
///