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, versioned HTML documentation.
- 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:
python tools/test_docs_examples.py
python tools/build_all_docs.py --site-root build/docs-site
python tools/check_built_docs.py --site build/docs-site
The existing library suite is compiled and run by GitHub Actions on Ubuntu and Windows. See CONTRIBUTING.md for contribution guidance and CHANGELOG.md for release history.
The generated documentation homepage is configured in docs/layout.json. Its optional homepage.banner block names an SVG kept in the repository and supplies the image's alternative text. The generator copies that SVG to the built site's assets/homepage-banner.svg and renders it on the homepage; do not edit generated index.html files or add the banner to Markdown pages manually.