Crates.io | text-editing |
lib.rs | text-editing |
version | 0.2.2 |
created_at | 2021-04-12 22:20:43.286665+00 |
updated_at | 2025-03-09 20:04:02.774504+00 |
description | A simple string with utilities for editing |
homepage | https://gitlab.com/porky11/text-editing |
repository | https://gitlab.com/porky11/text-editing |
max_upload_size | |
id | 382565 |
size | 19,340 |
A simple string with utilities for editing, specifically designed to work with non-ASCII strings.
TextLine
struct that represents an editable text line.Display
trait for easy conversion to a string.API documentation can be found at docs.rs/text-editing.
use text_editing::TextLine;
let mut line = TextLine::from_string("Hello, 🌍!".into());
line.insert(7, 'w');
assert_eq!(line.as_str(), "Hello, w🌍!");
let removed_char = line.remove(7);
assert_eq!(removed_char, 'w');
assert_eq!(line.as_str(), "Hello, 🌍!");