Crates.io | text-editing |
lib.rs | text-editing |
version | 0.2.1 |
source | src |
created_at | 2021-04-12 22:20:43.286665 |
updated_at | 2024-09-18 19:08:52.788841 |
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 | 20,244 |
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, 🌍!");