Easy-to-Use String Edit and String Tools.
npm install string-edit- String Edit and String Tools
- Easy-to-Use
npm install --save string-edit
`Features
- Latinization of text
- Removal of letters, number or special characters
- Random case, alternating case
- And many more...
Usage
` js
const stringEdit = require("string-edit");//Alternate case
stringEdit.alternateCase("my name is john"); // => "My NaMe Is JoHn"
stringEdit.alternateCase("my name is john", false, false); // => "mY NaMe iS JoHn"
//Reverse case
stringEdit.reverseCase("hEllO, WhaT'S Up?"); // => "HeLLo, wHAt's uP?"
//Find character's indexes
stringEdit.findCharIndexes("potato potatoes", "o"); // => [ 1, 5, 8, 12 ]
`
Functions
$3
This function latinizes the string.
For example: "héľĺô woŕlď" -> "hello world"
##### string
Type:
string
The string to be latinized.
$3
This function removes numbers.
For example: "1orange 2apples 3strawberries" -> "orange apples strawberries"
##### string
Type:
string
The string where the numbers will be removed.
$3
This function removes letters.
For example: "1orange 2apples 3strawberries 4úäňô" -> "1 2 3 4"
##### string
Type:
string
The string where the letters will be removed.
$3
This function removes special characters except whitespace.
For example: "hel-lo. wor,ld!" -> "hello world"
##### string
Type:
string
The string where the special characters will be removed.
$3
This function randomizes the case of characters.
For example: "apple" -> "aPPlE"
##### string
Type:
string
The string where the case will be randomized.
$3
This function alternates the case of characters.
For example: "strawberry" -> "StRaWbErRy"
##### string
Type:
string
The string where the case will be alternated.##### start_with_uppercase
Type:
boolean
Default value: true
The alternating case will start with uppercase if true.##### ignore_whitespace
Type:
boolean
Default value: true
Whitespaces will be ignored (they won't count as character) if true.
$3
This function reverses the string.
For example: "orange" -> "egnaro"
##### string
Type:
string
The string to be reversed.
$3
This function reverses case of every character in the string.
For example: "HelLo" -> "hELlO"
##### string
Type:
string
The string where the case will be reversed.
$3
This function finds every specific character's index in the string.
For example: "potato", "o" -> [ 1, 5 ]
##### string
Type:
string
The string that you want to search through.##### to_find
Type:
string
The character to be found.
$3
This function extracts every character in the string to array or string.
For example: "feeling!" -> [ "f", "e", "l", "i", "n", "g", "!" ] or "fe.el" -> "fe.l"
##### string
Type:
string
The string with characters that will extracted.##### to_array
Type:
boolean
Default value: true
Characters will be extracted to array if true (otherwise to string).##### repeat_characters
Type:
boolean
Default value: false
Characters won't repeat if false.
$3
This function shuffles the string.
For example: "entity" -> "tyetin"
##### string
Type:
string
The string to be shuffled.
$3
This function joins strings from array randomly.
For example: [ "ab", "cd", "ef" ] -> "cdefab" or [ "ab", "cd", "ef" ] -> "efcd"
##### array
Type:
array
The array from which the strings will be joined.##### join_specific_amount
Type:
number
Default value: 0`