count_chars
Count characters or bytes in text with options to include or exclude whitespace for accurate text length measurement and analysis.
Instructions
Count the length of input text.
- mode="chars": Unicode code points count (Python len).
- mode="bytes": UTF-8 encoded byte length.
- include_whitespace: when False, whitespace characters are filtered out before counting.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
include_whitespace | No | ||
mode | No | chars | |
text | Yes |
Input Schema (JSON Schema)
{
"properties": {
"include_whitespace": {
"default": true,
"title": "Include Whitespace",
"type": "boolean"
},
"mode": {
"default": "chars",
"enum": [
"chars",
"bytes"
],
"title": "Mode",
"type": "string"
},
"text": {
"title": "Text",
"type": "string"
}
},
"required": [
"text"
],
"title": "count_charsArguments",
"type": "object"
}