Practical string handling for Free Pascal and Lazarus: cleaning, identifier case conversion, validation, encoding, regex extraction, approximate matching, and readability helpers. It has no third-party runtime dependencies.
- Online Documentation — browsable HTML documentation with search, themes, and offline archives.
- Beginner Guide — installation and the first useful calls.
- Recipes — complete, compiled programs with expected output.
- Cheat Sheet — compact API reminder.
- API Reference — find the right area quickly.
The repository documentation index links to all beginner guides, topic guides, contracts, and helper references.
Add src/ to your project’s unit search path, then:
program FirstStringKitCall;
{$mode objfpc}{$H+}
uses
StringKit;
begin
Writeln(TStringKit.ToSnakeCase('HelloWorld'));
end.Compile from the repository root with:
fpc -Fusrc first_stringkit_call.pas
It prints hello_world; the same program is checked as a documentation example.
For Lazarus, open packages/lazarus/stringkit_fp.lpk, compile it, then select Use → Add to Project. You can instead add src/ under Project Options → Compiler Options → Paths → Other Unit Files.
The static API is the simplest starting point:
Clean := TStringKit.Trim(' hello ');Add StringKitHelper if you prefer the equivalent helper spelling:
Clean := ' hello '.Trim;They use the same implementation. Read Static API vs helper API before opting into selective SK_* helper flags.
SubStringuses Pascal 1-based indexing.- Current classification, case conversion, and encoding behaviour is largely byte/ASCII-oriented, not Unicode grapheme-aware.
- Validators are practical syntax checks, not complete RFC validation or reachability checks.
PercentEncodeuses%20for spaces;FormURLEncodeand legacyURLEncodeuse+.- Prefer
TryHexDecode,TryDecode64, andTryFromRomanwhen malformed input is expected.
See Contracts and limitations and Encoding for the details.
On a system with FPC 3.2.2 and DocSprout installed:
python tools/test_docs_examples.py
python -m docsprout check
python -m docsprout audit --strict
The library suite, documentation examples, and documentation site are validated by GitHub Actions on Ubuntu and Windows. See CONTRIBUTING.md for contribution guidance and CHANGELOG.md for release history.
The documentation site is built with DocSprout. Markdown lives in README.md and docs/; docs/layout.json controls the published pages and navigation, and docs/docsprout.json holds the project identity, the teal colour preset, the banner, and the homepage cards.
Install DocSprout and preview the site locally:
python -m pip install "https://github.com/ikelaiah/docsprout/archive/refs/tags/v1.1.2.zip"
python -m docsprout serve
Build the static site and, when you need a portable copy, the deterministic offline archive with its SHA-256 sidecar:
python -m docsprout build --output build/docs-site --release <release> --offline-archive build/artifacts/stringkit-fp-docs-<release>.zip
Version history restarts with the DocSprout pipeline, so the published site documents the current release until a new docs/versions.json history is introduced. The Publish documentation workflow validates and builds the site on every published release and on manual dispatch, deploys it to GitHub Pages, and uploads the offline ZIP as a build artifact.