Function voca_rs::manipulate::pad_right

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

Pads subject from right 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().
  • pad - The string to be used for padding.

Example

use voca_rs::*;
manipulate::pad_right("dog", 5, "");
// => "dog  "
manipulate::pad_right("bird", 6, "-");
// => "bird--"
manipulate::pad_right("Café del Mar", 15, "-=");
// => "Café del Mar-=-"
use voca_rs::Voca;
"dog"._pad_right(5, "");
// => "dog  "