We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f93c1d commit 2b01f96Copy full SHA for 2b01f96
README.md
@@ -16,17 +16,19 @@ Inspired by the "left-pad" NPM package (and the fiasco that happened after its r
16
17
## Example
18
``` rust
19
-use leftpad_rs::{pad,pad_char};
+use leftpad_rs::{pad,pad_char,pad_with};
20
21
fn main() {
22
let s = "foo";
23
24
println!("{}", pad(s, 5));
25
- println!("{:?}", pad_char(s, 5, 'b'));
+ let s1 = match pad_char(s, 6, ' ')) {
26
+ Ok(s) => s,
27
+ Err(e) => Err("Error: {}", e)
28
+ };
29
+ println!("{:?}", s1);
30
31
// You can use pad_with() too now.
- //println!("{:?}", pad_with(s, 5, 'b'));
-}
32
```
33
## crates.io
34
You can use this package in your project by adding the following
0 commit comments