Text prefix suffix check
text-prefix-suffix-check · version 1.0.0 · Text · free, no key needed
Exact prefix and/or suffix boolean checks using JS string startsWith/endsWith.
Use when you need to: text prefix check · text suffix check · starts with.
Supported
- text prefix check
- text suffix check
- starts with
- ends with
Not supported
- case insensitive
- grapheme
- locale
- regex
Behavior
- At least one of prefix or suffix must be present.
- Uses String.prototype.startsWith / endsWith (UTF-16 code units).
- Empty prefix or empty suffix is true for any text.
- A needle longer than text is false.
- Returned object includes starts_with only when prefix was supplied, ends_with only when suffix was supplied.
- No case folding, locale collation, grapheme segmentation, or regular expressions.
Input
text(string, required): max length 256000prefix(string, optional): max length 256000suffix(string, optional): max length 256000
Output
starts_with(boolean, optional)ends_with(boolean, optional)
Limits
- max input bytes: 256000
Example
Request input:
{
"text": "ComputeFirst",
"prefix": "Compute",
"suffix": "First"
}
Response:
{
"result": {
"starts_with": true,
"ends_with": true
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "text-prefix-suffix-check",
"version": "1.0.0",
"input": {
"text": "ComputeFirst",
"prefix": "Compute",
"suffix": "First"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/text-prefix-suffix-check/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"text":"ComputeFirst","prefix":"Compute","suffix":"First"}'
The machine-readable contract is at /v1/tools/text-prefix-suffix-check/versions/1.0.0.
CLI
node cli.mjs run text-prefix-suffix-check 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Text indentation detect: Detect whether a text uses tabs or spaces for indentation by counting lines.
- Text tabs to spaces: Convert tab characters to spaces.
- Text three way merge: Three-way merge of text line records with merge or diff3 conflict markers.
- Text unicode normalization check: Check if a text string is in various Unicode normalization forms (NFC, NFD, NFKC, NFKD).
- Text apply unified patch: Apply a one-file unified patch to text at original line addresses with exact hunk matches.
- Text conflict parse: Parse merge or diff3 conflict-marker text into ordered text and conflict parts.