Expand description
§String View
§Work with views into string slices. Safely extend, reduce without losing parent string size.
§Use in-place modifications to speed up your code
Example:
let program_text = r#"
fn main() {
let text = "Hello World";
}
"#;
use string_view::StrExt;
let mut view = program_text.view_part(0, 0);
view.extend_while(char::is_alphabetic);
view.extend_while(|ch| ch != ' ');
// view.reduce_left_while(char::is_alphabetic); todo!()
assert_eq!(view.as_str(), "fn");
Structs§
- Base
String IsToo Short - The only error case in
StringView::try_extend
. - Char
- In-place character representation inside str slice
- CharMut
- In-place character representation inside mutable str slice
- Chars
InPlace - Iterator of chars in-place
- Chars
InPlace Mut - Mutable iterator of chars in-place
- String
View - View
IsToo Short - The only error case in
StringView::try_reduce
.