txt_processor

Crates.iotxt_processor
lib.rstxt_processor
version0.1.4
sourcesrc
created_at2023-07-15 08:11:00.621299
updated_at2023-08-22 15:18:24.044784
descriptionA little library for text processing
homepagehttps://github.com/DaniilUbica/txt_processor
repositoryhttps://github.com/DaniilUbica/txt_processor
max_upload_size
id917047
size15,702
Daniil Volkov (DaniilUbica)

documentation

https://docs.rs/txt_processor

README

txt_processor Package Documentation

A little library for text processing.

Features

  • Read text from file
  • Append/Write text to file
  • Fix spaces in text
  • Count words in text
  • Count lines in text
  • Search words with index
  • Search words with filter
  • Search words with regex
  • Count word's occurences

Usage

[dependencies]
txt_processor = "0.1.4"

Examples

extern crate txt_processor;

use txt_processor::*;

fn main() {
    let mut t = TxtProcessor::from_str(String::from("This is text for example!"));
    t.replace_word("is", "replaced is");
    assert_eq!(1, t.get_lines());
    assert_eq!(5, t.get_words());
    assert_eq!("This replaced is text for example!", t.get_content());
}

You can find more examples in examples folder

Commit count: 9

cargo fmt