Skip to main content

StrExt

Trait StrExt 

Source
pub trait StrExt {
    // Required methods
    fn replace_trailing_spaces(&self, replacement: &str) -> String;
    fn has_trailing_spaces(&self) -> bool;
    fn trailing_spaces(&self) -> usize;
}
Expand description

Trait for string-related extensions

Required Methods§

Source

fn replace_trailing_spaces(&self, replacement: &str) -> String

Replace trailing spaces with a specified replacement string

Source

fn has_trailing_spaces(&self) -> bool

Check if the string has trailing whitespace

Source

fn trailing_spaces(&self) -> usize

Count the number of trailing spaces in the string

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StrExt for str

Implementors§