Skip to Content
NFSFU234FormValidation v3 is here — file upload validation, config-driven rules, and more.
v2 (legacy)countString

countString

The countString function counts the number of characters in a given string.

Works in: HTML5, React JS, Node.js

ParameterTypeDefaultDescription
strstringundefinedThe 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); // 11

See also

Last updated on