All examples
Language

Unicode text operations

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

Download .aner source
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.

With Aner installed, 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 the compatible native Aner development engine 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.

Iris and Wine are teaching datasets with their own attribution. Example outcomes are not comparative benchmarks or evidence of clinical validity.

Dataset sources & attribution
Install Aner