Skip to content

length

Module Export

text |> number

Returns the number of characters in a text value.

Examples

import { length } from 'text'
from 'hello' length
// Returns: 5
from '' length
// Returns: 0
from 'hello world' length
// Returns: 11

Notes

  • Returns the number of characters (not bytes) in the text
  • An empty string returns 0