Learn to Code ยท zero-dependency ยท MIT

larzstr

Classic string algorithms.

The little string problems every coder meets while learning - is it a palindrome? an anagram? how different are two words? - done correctly, tested, and ready to read. A study companion: reimplement them yourself, then check against a clean reference.

larzscript pkg install str
View on GitHub →Learn the stack

What you get

Try it

import "str" as str_
print(str_.is_palindrome("A man a plan a canal Panama"))
print(str_.is_anagram("listen", "silent"))
print(str_.edit_distance("kitten", "sitting"))
print(str_.char_frequency("banana"))
let enc = str_.caesar_encode("attack at dawn", 3)
print(enc, str_.caesar_decode(enc, 3))
Output
true
true
3
{b: 1, a: 3, n: 2}
dwwdfn dw gdzq attack at dawn

Why it's in the Larz Stack

larzstr is a real Larzscript package (larzscript pkg install str) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.