e1r0nd / Voca_rs
Licence: other
Voca_rs is the ultimate Rust string library inspired by Voca.js, string.py and Inflector, implemented as independent functions and on Foreign Types (String and str).
Stars: ✭ 167
Programming Languages
rust
11053 projects
Projects that are alternatives of or similar to Voca rs
Tiny Utf8
Unicode (UTF-8) capable std::string
Stars: ✭ 322 (+92.81%)
Mutual labels: unicode, string, string-manipulation, utf-8
Portable Utf8
🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.
Stars: ✭ 405 (+142.51%)
Mutual labels: unicode, string, string-manipulation, utf-8
Str
A fast, solid and strong typed string manipulation library with multibyte support
Stars: ✭ 199 (+19.16%)
Mutual labels: string, string-manipulation, utf-8
Stringz
💯 Super fast unicode-aware string manipulation Javascript library
Stars: ✭ 181 (+8.38%)
Mutual labels: unicode, string-manipulation, utf-8
Transliteration
UTF-8 to ASCII transliteration / slugify module for node.js, browser, Web Worker, React Native, Electron and CLI.
Stars: ✭ 444 (+165.87%)
Mutual labels: unicode, utf-8
String
Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way.
Stars: ✭ 709 (+324.55%)
Mutual labels: unicode, string
Php Confusable Homoglyphs
A PHP port of https://github.com/vhf/confusable_homoglyphs
Stars: ✭ 27 (-83.83%)
Mutual labels: unicode, string
Encoding.js
Convert or detect character encoding in JavaScript
Stars: ✭ 338 (+102.4%)
Mutual labels: unicode, utf-8
Mightystring
Making Ruby Strings Powerful
Stars: ✭ 28 (-83.23%)
Mutual labels: string, string-manipulation
Tomlplusplus
Header-only TOML config file parser and serializer for C++17 (and later!).
Stars: ✭ 403 (+141.32%)
Mutual labels: unicode, utf-8
Awesome Unicode
😂 👌 A curated list of delightful Unicode tidbits, packages and resources.
Stars: ✭ 693 (+314.97%)
Mutual labels: unicode, utf-8
Bstr
A string type for Rust that is not required to be valid UTF-8.
Stars: ✭ 348 (+108.38%)
Mutual labels: unicode, utf-8
Stringplus
Funny and minimal string library for C++ inspired by underscore.string
Stars: ✭ 7 (-95.81%)
Mutual labels: string, string-manipulation
Litestringbuilder
Alternative to the System.Text.StringBuilder C# class.
Stars: ✭ 48 (-71.26%)
Mutual labels: string, string-manipulation
Strman Java
A Java 8 string manipulation library.
Stars: ✭ 1,362 (+715.57%)
Mutual labels: string, string-manipulation
Unibits
Visualize different Unicode encodings in the terminal
Stars: ✭ 125 (-25.15%)
Mutual labels: unicode, utf-8
Voca_rs is a Rust library for manipulating [unicode] strings.
Voca_rs is inspired by Voca.js (JavaScript), string.py (Python), Inflector (Rust), and Grafite (PHP).
Voca_rs is implemented on Foreign Types, i.e. String
and str
. Respects Unicode.
TL;DR
Using functions:
use voca_rs::*;
let input_string = "LazyLoad with XMLHttpRequest and snake_case";
let string_in_words = split::words(&input_string);
// => ["Lazy", "Load", "with", "XML", "Http", "Request", "and", "snake", "case"]
let words_in_string = &string_in_words.join(" ");
// => "Lazy Load with XML Http Request and snake case"
let truncated_string = chop::prune(&words_in_string, 21, "");
// => "Lazy Load with XML..."
let sliced_string = chop::slice(&truncated_string, 5, -2);
// => "Load with XML."
let snaked_string = case::snake_case(&sliced_string);
// => "load_with_xml"
Using traits (all methods start from the underscore symbol):
use voca_rs::Voca;
"LazyLoad with XMLHttpRequest and snake_case"
._words()
// => ["Lazy", "Load", "with", "XML", "Http", "Request", "and", "snake", "case"]
.join(" ")
// => "Lazy Load with XML Http Request and snake case"
._prune(21, "")
// => "Lazy Load with XML..."
._slice(5, -2)
// => "Load with XML."
._snake_case();
// => "load_with_xml"
Documentation
See the complete documentation at https://e1r0nd.github.io/voca_rs/
Run tests: cargo test
Build docs: cargo doc
-> ./target/doc/voca_rs/index.html
Build a project: cargo build
-> ./target/debug
Functions
Case
- camel_case
- capitalize
- decapitalize
- kebab_case
- lower_case
- lower_first
- pascal_case
- shouty_kebab_case
- shouty_snake_case
- snake_case
- swap_case
- title_case
- train_case
- upper_case
- upper_first
Chop
- after
- after_last
- before
- before_last
- char_at
- code_point_at
- first
- foreign_key
- grapheme_at
- last
- max
- min
- prune
- removeprefix
- removesuffix
- slice
- substr
- substring
- truncate
Count
Escape
Index
Manipulate
- expand_spaces
- expand_tabs
- insert
- latinise
- pad
- pad_left
- pad_right
- repeat
- replace
- replace_all
- reverse
- reverse_grapheme
- slugify
- splice
- tr
- trim
- trim_left
- trim_right
- word_wrap
- zfill
Query
- ends_with
- includes
- is_alpha
- is_alphadigit
- is_blank
- is_camel_case
- is_capitalize
- is_decapitalize
- is_digit
- is_empty
- is_foreign_key
- is_lowercase
- is_lower_first
- is_kebab_case
- is_shouty_kebab_case
- is_numeric
- is_pascal_case
- is_snake_case
- is_shouty_snake_case
- is_title
- is_train_case
- is_uppercase
- is_upper_first
- matches
- query
- starts_with
Split
Strip
Utils
- ASCII_LETTERS
- ASCII_LOWERCASE
- ASCII_UPPERCASE
- DIGITS
- HEXDIGITS
- OCTDIGITS
- PUNCTUATION
- PRINTABLE
- WHITESPACE
- VERSION
Roadmap
- Ensure respecting unicode string for each method. Update each function's description clearly stating whether it works with UTF or ASCII.
- Possible refactoring: all
position
indexes covert to zero-based and add a comment to each doc - Change all inner arguments to Enums (instead
string
orbool
) - To ensure that all regexp expressions are wrapped by
lazy_static
Chop
Format
- vprintf - link
Manipulate
- finish - link
- start - link
- deordinalize - link
- pluralize - link
- singularize - link
- ordinalize - link
Copyright
coded by Anatol Marezhanyi @e1r0nd_crg
https://www.linkedin.com/in/e1r0nd/
https://www.youtube.com/c/AnatolMerezhanyi
License
Licensed under MIT License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].