[][src]Trait ext_string::ExtString

pub trait ExtString {
    fn reverse(&self) -> String;
fn pad_left(&self, pad_len: usize, c: char) -> String;
fn pad_right(&self, pad_len: usize, c: char) -> String;
fn pad_left_str(&self, pad_len: usize, s: &str) -> String;
fn pad_right_str(&self, pad_len: usize, s: &str) -> String;
fn is_numeric(&self) -> bool;
fn is_alphabetic(&self) -> bool;
fn swap_case(&self) -> String; }

The trait that adds functionality to the String struct.

Required methods

fn reverse(&self) -> String

Reverses order of characters

fn pad_left(&self, pad_len: usize, c: char) -> String

Pads the left side of a string by repeating the same character until 'pad_len' is reached. If pad_len is shorter or equal to the character length, a simple cloned string will be returned.

fn pad_right(&self, pad_len: usize, c: char) -> String

Pads the right side of a string by repeating the same character until 'pad_len' is reached. If pad_len is shorter or equal to the character length, a simple cloned string will be returned.

fn pad_left_str(&self, pad_len: usize, s: &str) -> String

Pads the left side of a string by repeating the same string slice until 'pad_len' is reached. If pad_len is shorter or equal to the character length, a simple cloned string will be returned.

fn pad_right_str(&self, pad_len: usize, s: &str) -> String

Pads the right side of a string by repeating the same string slice until 'pad_len' is reached. If pad_len is shorter or equal to the character length, a simple cloned string will be returned.

fn is_numeric(&self) -> bool

Checks that all characters in a string are numeric characters.

fn is_alphabetic(&self) -> bool

Checks that all characters in a string are alphabetic characters.

fn swap_case(&self) -> String

Swaps upper case characters to lower case and vice versa.

Loading content...

Implementations on Foreign Types

impl ExtString for String[src]

fn reverse(&self) -> String[src]

Reverses order of characters

fn pad_left(&self, pad_len: usize, c: char) -> String[src]

Pads the left side of a string by repeating the same character until 'pad_len' is reached. If pad_len is shorter or equal to the character length, a simple cloned string will be returned.

fn pad_right(&self, pad_len: usize, c: char) -> String[src]

Pads the right side of a string by repeating the same character until 'pad_len' is reached. If pad_len is shorter or equal to the character length, a simple cloned string will be returned.

fn is_numeric(&self) -> bool[src]

Checks that all characters in a string are numeric characters.

fn is_alphabetic(&self) -> bool[src]

Checks that all characters in a string are alphabetic characters.

Loading content...

Implementors

Loading content...