| Crates.io | switchstring |
| lib.rs | switchstring |
| version | 0.1.1 |
| created_at | 2021-05-28 12:17:21.549193+00 |
| updated_at | 2021-05-28 12:34:51.242917+00 |
| description | subtractable strings |
| homepage | https://github.com/lf-/switchstring |
| repository | https://github.com/lf-/switchstring |
| max_upload_size | |
| id | 403091 |
| size | 12,295 |
it's a string, but unlike a string where you can add substrings, you can subtract substrings here as well. it is thus a switchstring
to make mathematicians (and maybe you) suffer of the knowledge that this exists
use switchstring::Switchstring;
let a = "I promise I love maths";
let b = "maths";
let c = "cute rustaceans such as ferris";
let d: Switchstring = "I promise ".into();
let improved = String::from(-d + a - b + c);
assert_eq!("I love cute rustaceans such as ferris", improved);