| Crates.io | count-characters |
| lib.rs | count-characters |
| version | 0.1.4 |
| created_at | 2025-04-26 05:23:29.167979+00 |
| updated_at | 2025-05-04 03:25:20.024562+00 |
| description | A simple Rust program to count characters in a string |
| homepage | https://github.com/anhkhoakz/some-rust-scripts/tree/main/count-characters |
| repository | https://github.com/anhkhoakz/some-rust-scripts/tree/main/count-characters |
| max_upload_size | |
| id | 1649902 |
| size | 12,958 |
Count Characters is a simple CLI tool written in Rust that counts the number of characters in a given input, including support for reading from files. It trims leading and trailing blank lines and is designed for quick, efficient use in the terminal.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Clone the repository:
git clone https://github.com/anhkhoakz/some-rust-scripts/
cd some-rust-scripts
cd count-characters
Install the binary (optional, requires sudo):
just install
# or from crates.io:
cargo install count-characters
To uninstall:
just uninstall
# or from crates.io:
cargo uninstall count-characters
You can run the tool with:
./target/release/count-characters
Or, if installed:
count-characters
Paste your text, then press Ctrl-D (on Mac/Linux) or Ctrl-Z (on Windows) to finish input. The tool will output the number of characters in your input (excluding leading/trailing blank lines).
Example:
$ count-characters
Paste your text, then press Ctrl-D (on Mac/Linux) or Ctrl-Z (on Windows) to finish:
Hello, world!
Input contains 13 characters.
$ count-characters /path/to/file.txt
Input contains 42 characters.
This project is licensed under the GNU General Public License version 2 - see the LICENSE file for details.