[−][src]Function voca_rs::manipulate::zfill
pub fn zfill(subject: &str, length: usize) -> String
Pads subject
from left with zeros to a new length
.
Arguments
subject
- The string to pad.length
- The length to pad the string. No changes are made iflength
is less thansubject.len()
.
Example
use voca_rs::*; manipulate::zfill("123", 5); // => "00123" manipulate::zfill("Café", 7); // => "000Café" use voca_rs::Voca; "123"._zfill(5); // => "00123"