String Utilities

Lightpack’s Str utility class offers a comprehensive set of methods for string manipulation, formatting, validation, and generation. It is designed to cover common and advanced string operations with a clear, expressive API and robust error handling.


Inflection & Naming


Slugs & URL Helpers


String Checks


Random, Masking, and Truncation


Padding & Casing


HTML & Content Helpers


Validation Helpers


File & Path Helpers


Character Filters


One-Time Password (OTP)

For more complex OTP generation, Lightpack provides a robust OTP utility OTP Utility