All examples
Language

Unicode text operations

Use native immutable text, scalar indexing, literal fields, Unicode casing and explicit scalar conversion without imports.

string_basic.aner
// Immutable built-in Unicode text; no import is required.
let text: String = "  café 🧪  "
let clean = text.trim()
print(clean)
print(clean.len())
print(clean.byte_len())
print(clean.get(index: 3))
print(clean.slice(start: 0, end: 4))
print(clean.find(needle: "🧪"))
print(clean.contains(needle: "café"))
print(clean.starts_with(prefix: "café"))
print(clean.ends_with(suffix: "🧪"))

let fields = "sample,,control,".split(separator: ",")
print(fields)
print(" | ".join(parts: fields))
print("banana".count(needle: "ana"))
print("banana".replace(old: "ana", new: "X"))
print("Straße".upper())
print("Straße".casefold() == "STRASSE".casefold())
print("A".repeat(count: 3))
print("study-".concat(other: String(42)))
print("sample " + String(true))
print("a".compare(other: "b"))
print(text)

Make it your experiment.

Use Aner 0.0.3 or newer. Save this program as examples/string_basic.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/string_basic.aner
aner run examples/string_basic.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Use Aner 0.0.4 or newer with built in String methods, type and dtype, and VS Code extension 0.1.36 or newer. No import is required. Unicode indices count scalar values, not grapheme clusters or bytes; text is not normalized implicitly. dtype always reports Any for core heterogeneous containers. See String and Type inspection for checked conversions, limits and time/space complexity.

Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.

Dataset sources & attribution
Install Aner