textx

A small and simple string utilities library written in Gleam.

Package VersionHex DocsRepository


Features


Installation

gleam add textx

Example

import textx
pub fn main() {
textx.reverse("gleam")
textx.is_palindrome("madam")
textx.capitalize("hello")
textx.word_count("hello world")
}

API

reverse(text: String) -> String

Reverses a string using grapheme-safe operations.


is_palindrome(text: String) -> Bool

Returns True if the string reads the same forwards and backwards.


capitalize(text: String) -> String

Capitalizes the first letter of a string.


word_count(text: String) -> Int

Counts words separated by spaces.


Repository

https://github.com/dj-kaif/textx


Notes

This library is designed for learning Gleam package structure, including: