logo
pub trait StringExtensions {
    fn file_extension(&self) -> Option<String>;
    fn remove_file_extension(&self) -> String;
    fn url_extension(&self) -> Option<String>;
    fn join_path(&self, relative: String) -> String;
    fn hash_code<S: Into<String>>(&self, str: S) -> u32;
    fn substitute(&self, values: Vec<String>) -> String;
}
Expand description

Utility mixins for Strings. Designed to be imported with ‘using’.

Required Methods

Gets the extension of a file name, or None if there is no extension

Returns a file name without its extension

Gets the extension of a full path or URL, with special handling for ‘/’ and ‘?’ characters. Returns None if there is no extension

Joins two strings with a path separator

Substitute all “{n}” tokens with the corresponding values.

Implementations on Foreign Types

Implementors