Text split exact
text-split-exact · version 1.0.0 · Text · free, no key needed
Split text on an exact literal separator and reject results that exceed max_parts.
Use when you need to: text split exact · split text on exact separator · exact substring split.
Supported
- text split exact
- split text on exact separator
- exact substring split
Not supported
- regular expression split
- truncating split limits
- case-insensitive split
- keep-separator mode
- locale-aware tokenization
- read files
Behavior
- text is a UTF-8 bounded string of at most 250 KiB. Empty text always yields parts [""] (one empty part).
- separator is a non-empty literal string of at most 4096 UTF-8 bytes, never a regular expression.
- max_parts is a required JSON integer 1..10000. If the split would produce more parts than max_parts, the tool throws split exceeds max_parts.
- Matching is exact UTF-16 code-unit equality, left to right and non-overlapping, without case folding or Unicode normalization.
- Consecutive separators produce empty parts. A leading or trailing separator produces a leading or trailing empty part.
- Successful splits satisfy parts.join(separator) === text.
Input
text(string, required): max length 256000separator(string, required): min length 1; max length 4096max_parts(integer, required): min 1; max 10000
Output
parts(array of string, required): min items 1; max items 10000
Limits
- max text bytes: 256000
- max separator bytes: 4096
- max parts: 10000
Example
Request input:
{
"text": "a,b,c",
"separator": ",",
"max_parts": 10
}
Response:
{
"result": {
"parts": [
"a",
"b",
"c"
]
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "text-split-exact",
"version": "1.0.0",
"input": {
"text": "a,b,c",
"separator": ",",
"max_parts": 10
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/text-split-exact/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"text":"a,b,c","separator":",","max_parts":10}'
The machine-readable contract is at /v1/tools/text-split-exact/versions/1.0.0.
CLI
node cli.mjs run text-split-exact 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Text replace exact: Replace exact UTF-16 substrings without regex, case folding, or Unicode normalization.
- Text conflict parse: Parse merge or diff3 conflict-marker text into ordered text and conflict parts.
- Text extract between: Extract exact substrings between start and end markers, left to right and non-overlapping.
- Text lines chunk: Split parsed lines into consecutive chunks of size lines each.
- Text slice codepoints: Slice a string by Unicode code-point indexes, not UTF-16 code units.
- Text apply unified patch: Apply a one-file unified patch to text at original line addresses with exact hunk matches.