stringLength
Returns the length of the supplied string.
Signature
stringLength(input: any): number
Parameters
Name | Type | Optional | Description |
---|---|---|---|
input | any | No | Specifies the string |
Return value
Returns the length of the string or 0
if the supplied variable is not a valid string or an empty string.
Example
import { stringLength } from "@tripetto/builder";
stringLength("ABC"); // Returns `3`
stringLength(1); // Returns `0`