Function kalgan_string::strip
source · [−]Expand description
Removes the given character at the beginning and at the end of the string.
Examples
use kalgan_string;
assert_eq!(kalgan_string::strip("Hello World", 'H'), "ello World");
use kalgan_string;
assert_eq!(kalgan_string::strip("Hello World", 'd'), "Hello Worl");
use kalgan_string;
assert_eq!(kalgan_string::strip("-Hello World-", '-'), "Hello World");