reddish

Crates.ioreddish
lib.rsreddish
version0.2.0
sourcesrc
created_at2022-10-14 16:31:53.425285
updated_at2022-10-20 12:26:16.392563
descriptionA Rust utility library
homepagehttps://reddish.github.io
repositoryhttps://github.com/rodgeraraujo/reddish
max_upload_size
id688364
size9,679
Rogério Araújo (rodgeraraujo)

documentation

https://docs.rs/reddish

README

reddish

Crates.io Documentation License

reddish library logo

A Rust utility library, making easier by taking the hassle out of working.


Usage

Add this to your Cargo.toml:

[dependencies]
reddish = "0.2.0"

Example

extern crate reddish;
use reddish::*;

fn main() {
  println!("{}", snake_case("fooBarBaz"));
  // foo_bar_baz
}

Features

  • “String” Methods

    • .camel_case([string='']): Converts string to camel case.
    • .capitalize([string='']): Capitalize first char of string.
    • .kebab_case([string='']): Converts string to kebab case.
    • .snake_case([string='']): Converts string to snake case.
    • .title_case([string='']): Converts string to title case.
    • .pad([string=''], pad_length, pad_char=' '): Adds padding of length pad_length to both ends of string using optional pad_char, if no pad_char is supplied the pad_char defaults to ' '
    • .pad_end([string=''], pad_length, pad_char=' '): Adds padding of length pad_length to the end of string using optional pad_char, if no pad_char is supplied the pad_char defaults to ' '
    • .truncate([string=''], truncate_length): Truncates string to truncate_length.
  • “Array” Methods

    • .concat(vec: Vec<T>, values: Vec<T>): Creates a new array concatenating an array with any additional array values.
    • .difference(vec: Vec<T>, values: Vec<T>): Creates an array of values not included in the other given arrays using the same for equality comparisons.
    • .find_index(vec: Vec<T>, find: F): Returns the index of the first found element.
    • .find_last_index(vec: Vec<T>, find: F): Iterates over elements of collection from right to left, and returns the index of the found element.
    • .join(vec: Vec<T>, sep: &str): Converts all elements in array into a string separated by separator.
  • “Object” Methods

    • TODO:
  • “Collection” Methods

    • TODO:
Commit count: 8

cargo fmt