Description
Normalize CRLF and CR to LF, split into lines, and remove one final empty split item.
Text layout distinguishes Unicode characters, encoded bytes, and visual columns. These counts need not agree: a tab depends on its column position, while a newline is a sequence of characters with a particular spelling.
Normalize CRLF and CR to LF, split into lines, and remove one final empty split item.
When to use this tool
Use Hymn Stanza Line Count when you need one deterministic text-layout or encoding component under the stated counting convention.
How to use the tool and how it works
- Enter stanza. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read lineCount. Use the output convention below.
Normalize CRLF and CR to LF, split into lines, and remove one final empty split item. Return zero for empty input and otherwise the remaining line count.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| stanza | Stanza | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| lineCount | Line Count | Required. Safe integer. |
{
"input": {
"stanza": "First line\nSecond line\n"
},
"output": {
"lineCount": 2
}
} Limitations and assumptions
- Interior blank lines count, and multiple terminal newlines can leave blank lines; no stanza structure or poetic meter is interpreted.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Inspect the final text in the target encoding and renderer when display width or line wrapping matters.
References
Similar or alternative tools
- Headline Character Budget
Count headline by Unicode code points.
- Festival Program Slot Duration
Require nonnegative integer startMinute and endMinute no earlier than start, then return their difference.