Useful functions for modifying and managing strings.
npm install @reverse/string> Useful functions for modifying and managing strings.
You can install with nodejs and npm
```
npm i @reverse/string
- capitalize
- format
- isValidEmail
> Capitalizes the first letter of a string.
- string: String: The string to modify.
`js
import { capitalize } from '@reverse/string';
capitalize('hello');
// "Hello"
capitalize('123abc');
// "123abc"
`
> Formats a string by substituting variables.
- format: String: The string to format....variables: Any
- : Any variables to substitute in the string.
`js
import { format } from '@reverse/string';
format('Hello $1.', 'World');
// "Hello World."
format('I like $2 and $1.', 'cats', 'dogs');
// "I like dogs and cats."
`
> Checks if a email is a valid formatted email.
- email: String: The email to check.
`js
import { isValidEmail } from '@reverse/string';
isValidEmail('example@example.com');
// true
isValidEmail('ample.com');
// false
`
> Makes a word plural if the number is not one.
- number: number: The amount of that object.word: string
- : The word to plural-ize.
`js
import { plural } from '@reverse/string';
plural(0, 'Dog');
// Dogs
plural(1, 'Dog');
// Dog
plural(10, 'Dog');
// Dogs
``