Function voca_rs::manipulate::zfill

source ·
pub fn zfill(subject: &str, length: usize) -> String
Expand description

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 if length is less than subject.len().

Example

use voca_rs::*;
manipulate::zfill("123", 5);
// => "00123"
manipulate::zfill("Café", 7);
// => "000Café"
use voca_rs::Voca;
"123"._zfill(5);
// => "00123"