Skip to content

Main content

Hymn Stanza Line Count Tool

Count physical stanza lines, treating one final newline as a terminator rather than an extra line; blank internal lines count.

Loading tool…

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

  1. Enter stanza. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
stanzaStanzaRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
lineCountLine CountRequired. Safe integer.
json
{
  "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

  1. Calculation and input contract: religious-studies/hymn-stanza-line-count — tool.io

Similar or alternative tools