string-utils
Comprehensive string manipulation library for PascalAI. Split, join, trim, pad, search, and transform strings with a clean functional API.
Install
ppm install string-utils
Usage Example
uses string_utils;
var text := ' Hello, World! ';
// Basic operations
var trimmed := Trim(text); // 'Hello, World!'
var lower := ToLower(trimmed); // 'hello, world!'
var upper := ToUpper(trimmed); // 'HELLO, WORLD!'
// Search
var hasCom := Contains(text, 'World'); // True
var startsH := StartsWith(trimmed, 'Hello'); // True
var endsEx := EndsWith(trimmed, '!'); // True
// Split and join
var parts := Split('a,b,c', ','); // ['a','b','c']
var joined := Join(parts, ' | '); // 'a | b | c'
// Padding
var padded := PadLeft('42', 6, '0'); // '000042'
Features
Split strings by delimiter into arrays
Join arrays back into strings with separator
Trim leading and trailing whitespace
PadLeft and PadRight with custom fill character
Contains, StartsWith, EndsWith predicates
ToLower, ToUpper case conversion
IndexOf, Substring, Replace string operations