Skip to content

Main content

Ini Comment Leading Space Policy Tool

Apply an explicitly supplied leading-horizontal-whitespace policy for full-line INI comments.

Loading tool…

Description

Apply an explicitly supplied leading-horizontal-whitespace policy for full-line INI comments.

INI-style configuration formats share section, assignment, and comment conventions but differ across implementations. Delimiters and whitespace policies need to be explicit, especially inside quoted or escaped values. A local split or prefix check should be interpreted under its stated dialect.

Apply an explicitly supplied leading-horizontal-whitespace policy for full-line INI comments.

When to use this tool

Use Ini Comment Leading Space Policy when you need this specific INI-style assignment, section, or comment check under an explicit policy.

How to use the tool and how it works

  1. Enter line, allowLeadingSpace. 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 comment, marker. Inspect comment before interpreting the associated values.

Optionally remove leading ASCII spaces and tabs when allowLeadingSpace. Return comment when the resulting line starts with ; or # and marker as that character, otherwise an empty marker.1

Input fieldMeaning and unitsAccepted input
lineOne supplied line under the stated newline policy.Required. Text; maximum UTF-16 length 8192.
allowLeadingSpaceAllow Leading SpaceRequired. Boolean.
Output fieldInterpretationReturned shape
commentCommentRequired. Boolean.
markerMarkerRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "line": "  ; note",
    "allowLeadingSpace": true
  },
  "output": {
    "comment": true,
    "marker": ";"
  }
}

Limitations and assumptions

  • Only the prefix is checked. Other Unicode whitespace, inline comments, multiline constructs, and INI-specific quoting or document rules are not parsed.
  • 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

Choose the target application's INI dialect for a complete configuration parser. Verify quoting, comments, interpolation, duplicate keys, and section state beyond one local split.

References

  1. Calculation and input contract: parse/ini-comment-leading-space-policy — tool.io

Similar or alternative tools