Skip to main content

README.md

# textx

A small and simple string utilities library written in Gleam.

[![Package Version](https://img.shields.io/hexpm/v/textx)](https://hex.pm/packages/textx)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/textx/)
[![Repository](https://img.shields.io/badge/github-repo-black)](https://github.com/dj-kaif/textx)

---

## Features

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

---

## Installation


```sh
gleam add textx
```

---

## Example

```gleam
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