Description
Return max(0, memberCount - 1) as commas and choose comma-space or comma according to pretty.
A JSON lexeme is its textual spelling, which differs from the decoded value. Escapes, quotes, raw control characters, and surrounding whitespace must be interpreted in context.
Return max(0, memberCount - 1) as commas and choose comma-space or comma according to pretty.
When to use this tool
Use JSON Object Member Separator Token when you need a narrowly defined JSON string or separator diagnostic.
How to use the tool and how it works
- Enter memberCount, pretty. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read commas, separator. Use the output convention below.
Return max(0, memberCount - 1) as commas and choose comma-space or comma according to pretty.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| memberCount | Member Count | Required. Safe integer; minimum 0. |
| pretty | Pretty | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| commas | Commas | Required. Safe integer. |
| separator | Separator | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"memberCount": 3,
"pretty": true
},
"output": {
"commas": 2,
"separator": ", "
}
} Limitations and assumptions
- This counts separators and returns their spelling; it does not serialize keys, values, braces, or multiline indentation.
- 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.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Parse the entire document when validity matters; a local pattern match cannot establish complete JSON syntax.
References
Similar or alternative tools
- List Pairwise Adjacency Output Count
Return zero pairs for an empty list.
- JSON String Escape Length Budget
Serialize value as a JSON string and return source UTF-16 length, complete serialized length, and their difference as overhead.