This is a utility package. You can use this to check the availibility of capitals, symbols or numbers in a string and also seperate a string into chuncks.
- caps(phrase)
- numbers(phrase)
- symbols(phrase)
- fullCount(phrase)
- isEnglish(phrase)
- allNums(phrase)
- allSymbols(phrase)
- allCaps(phrase)
- sliceToChunks(phrase, number)
npm i chkchars
Checks if there are capital english letters in a given string. phrase: string
{
status: true / false --- true === contains false === does not contain
count: number --- number of caps in the given phrase
fount: array --- all the caps found in the given phrase (no duplicates)
}
Checks if there are numbers in a given string. phrase: string
{
status: true / false --- true === contains false === does not contain
count: number --- number of numbers in the given phrase
fount: array --- all the numbers found in the given phrase (no duplicates)
}
Checks if there are symbols in a given string. phrase: string
{
status: true / false --- true === contains false === does not contain
count: number --- number of symbols in the given phrase
fount: array --- all the symbols found in the given phrase (no duplicates)
}
Returns the number of occurences of all caps, numbers and symbols
{
caps: --- number of english capital letters found.
numbers: --- number of numbers found.
symbols: --- number of symbols found.
}
Checks if the given string is composed only with english letters.
If all the characters are english letters
true
If at least one of them not a english letter
false
Checks if the given string is composed only with numbers.
If all the characters are numbers
true
If at least one of them not a number
false
Checks if the given string is composed only with symbols.
If all the characters are symbols
true
If at least one of them not a symbol
false
Checks if the given string is composed only with english capital letters.
If all the characters are english capital letters
true
If at least one of them not a english capital letter
false
Slices a given string into chuncks of length of given "number" parameter. Remember to provide a string of length that is perfectly divided by the "number" parameter.
This method returns a array of strings.
If phrase === "dictionary" number === 5
output
["dicti", "onary"]