Description
Slice caller-segmented grapheme clusters and report UTF-16 edge offsets; segmentation correctness belongs to the caller.
Text positions can be measured in UTF-16 code units, Unicode code points, grapheme clusters, or modeled display columns. These coordinates are not interchangeable. Invisible markers and delimiter policies can also affect interpretation even when a string looks unchanged, so the chosen representation needs to stay explicit.
Slice caller-segmented grapheme clusters and report UTF-16 edge offsets; segmentation correctness belongs to the caller.
When to use this tool
Use Grapheme Edge Slice Boundary when you need the stated marker, coordinate, delimiter, or normalization operation under an explicit text representation.
How to use the tool and how it works
- Enter graphemes, start, end. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read slice, startUtf16, endUtf16. Use the output convention below.
Slice supplied nonempty graphemes from zero-based start through exclusive end, join them, and return prefix-derived startUtf16 and endUtf16 offsets. Require ordered indices within the supplied list.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| graphemes | Nonempty supplied string pieces trusted as grapheme units. | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| start | Start | Required. Safe integer; minimum 0. |
| end | End | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| slice | Slice | Required. Text; maximum UTF-16 length 8192. |
| startUtf16 | UTF-16 prefix length before start. | Required. Safe integer. |
| endUtf16 | UTF-16 prefix length before exclusive end. | Required. Safe integer. |
{
"input": {
"graphemes": [
"A",
"é",
"👩🚀",
"B"
],
"start": 1,
"end": 3
},
"output": {
"slice": "é👩🚀",
"startUtf16": 1,
"endUtf16": 8
}
} Limitations and assumptions
- Grapheme boundaries are trusted input, not segmented or validated. Offsets are UTF-16 units, and an empty slice is permitted without proving the supplied pieces are actual clusters.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Choose the coordinate system required by the consumer. Use a full parser, renderer, or segmentation method when a local marker or delimiter rule cannot determine the complete text behavior.
References
Similar or alternative tools
- Grapheme Boundary Side Token
Locate an offset relative to caller-supplied grapheme boundaries; no Unicode segmentation is inferred.
- Grapheme Cursor Mid Cluster Flag
Segment text using Intl.Segmenter with locale en and grapheme granularity.