4 releases

Uses old Rust 2015

0.1.4 Aug 22, 2023
0.1.3 Jul 15, 2023
0.1.2 Jul 15, 2023
0.1.1 Jul 15, 2023

#1473 in Text processing

Download history 6/week @ 2024-02-25 2/week @ 2024-03-10 50/week @ 2024-03-31

52 downloads per month

MIT license

15KB
308 lines

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

Dependencies

~2.6–3.5MB
~62K SLoC