ncase [ɪn'keɪs] — enforce a case style
Binary
Install
% cargo install ncase
Usage
Enforce the chosen case style on a string and write it to the standard output.
% ncase --pascal this is a test string
ThisIsATestString
% ncase --lower ThisIsATestString
this is a test string
By default, enforces the random case.
% ncase this is a test string
ThiS IS A tesT stRINg
Library
Install
Add the dependency to your Cargo.toml
.
[]
= "0.1"
Or from the command line.
% cargo add ncase@0.1
Usage
Use the functions for one-off case conversions.
assert_eq!;
assert_eq!;
Use Words
if you need to convert one string into many case styles.
use Words;
let s = "Lorem ipsum dolor sit amet";
let w = from;
assert_eq!;
assert_eq!;
Or if you want to use the separator regex.
use Words;
use Regex;
let s = "Lorem, ipsum (dolor _sit)_ amet";
let sep = new.unwrap;
let w = with_separator;
assert_eq!;
assert_eq!;