# textkit — literal text scalpel

`import textkit;` cuts text by **literal markers and lines**: no regex, no escaping, no positions; case-sensitive. Missing marker → `null`; found but empty → `""` (truthy, so `: fallback` works). `null` input → `null`, so a chain needs one check at the end.

```aardio
import textkit;
var title = textkit.between(html, "<title>", "</title>") : "untitled"; // first pair, markers excluded
var key, value = textkit.splitOnce(line, "=");                        // TWO values, not an array; both null if no "="
var code = textkit.mapLines(src, function(line, lineNo){
	if(string.indexOf(line, "DEBUG")) return false; // false = drop line; no return = keep; string = new line text
});
```

- Same shape: `before(s,mark)`, `after(s,mark)` → first match; `replaceBetween(s,begin,end,new)` keeps the markers → new text | `null`.
- Indent: `indent(s,prefix)` prefixes non-blank lines (`'\t'`, `"    "`, `"> "`, `"// "`); `dedent(s)` strips the common leading SPACE/TAB (TAB != spaces). Move a block: `textkit.indent(textkit.dedent(block), "    ")`.
- Lines: each original CRLF/LF/CR is kept; `fn` returns line text only, never the EOL.
- Use `string` instead: split all → `string.splitLiteral(s,sep)` (`string.split` = char set!); replace all → `string.replaceLiteral(s,old,new)`; EOL → `string.crlf(s,'\n')`; patterns, positions, length → `string.match/find/slice`, `#s`.
- Not for: nested, quoted or escaped syntax (use a parser); editing existing files (use the file edit tools).
