1pub const CONCAT_SYMBOL: &str = "std::string::concat";
3pub const STARTS_WITH_SYMBOL: &str = "std::string::starts_with";
5pub const DROP_SYMBOL: &str = "std::string::drop";
7pub const TAKE_SYMBOL: &str = "std::string::take";
9
10pub fn concat(left: String, right: String) -> String {
12 format!("{left}{right}")
13}
14
15pub fn starts_with(value: String, prefix: String) -> bool {
17 value.starts_with(&prefix)
18}
19
20pub fn drop(value: String, count: i64) -> String {
22 let count = usize::try_from(count).expect("string drop count must be non-negative");
23 value.chars().skip(count).collect()
24}
25
26pub fn take(value: String, count: i64) -> String {
28 let count = usize::try_from(count).expect("string take count must be non-negative");
29 value.chars().take(count).collect()
30}