element.version === currentVersion)) { versionNodes.unshift({ version: currentVersion, url: "#" }); } document.querySelector("#project-version").innerHTML = versionNodes.reduce( (acc, element) => { const status = currentVersion === element.version ? "selected disabled" : ""; return ` ${acc} `; }, `
textx · v0.1.0

textx

A small and simple string utilities library written in Gleam.

Package Version Hex Docs Repository


Features

  • Reverse strings
  • Check palindromes
  • Capitalize first letter
  • Count words in a string

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:

  • modules
  • tests
  • publishing to Hex
  • functional string processing
Search Document