countString
The countString function counts the number of characters in a given string.
Works in: HTML5, React JS, Node.js
| Parameter | Type | Default | Description |
|---|---|---|---|
str | string | undefined | The string whose characters are to be counted. |
Usage
Example: Count Characters in a String
const text = 'Hello World';
const characterCount = nfsfu234FormValidation.countString(text);
console.log(characterCount); // 11See also
Last updated on