aardio 文档

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.

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
});

Markdown 格式