scsys_core/traits/ext/string.rs
1/*
2 Appellation: string <module>
3 Contrib: FL03 <jo3mccain@icloud.com>
4*/
5#![cfg(feature = "alloc")]
6
7use alloc::string::String;
8
9pub trait StringExt {
10 /// Remove the first and last charecters of a string
11 fn remove_fnl(&self) -> &str;
12}
13
14impl StringExt for str {
15 fn remove_fnl(&self) -> &str {
16 &self[1..self.len() - 1]
17 }
18}
19
20pub trait StringFmt {
21 fn snake_case(&self) -> String;
22
23 fn title_case(&self) -> String;
24}