StringExtensions
String manipulation and formatting extension methods.
API Reference
| Method | Return | Description |
|---|---|---|
| IsNullOrWhiteSpace(this string?) | bool | True if null/empty/whitespace |
| HasValue(this string?) | bool | True if has content |
| NullIfEmpty(this string?) | string? | Null if empty, trimmed otherwise |
| Truncate(this string?, int, string) | string | Truncates with suffix |
| ToSnakeCase(this string) | string | UserName to user_name |
| ToKebabCase(this string) | string | UserName to user-name |
| ToPascalCase(this string) | string | user_name to UserName |
| ToCamelCase(this string) | string | user_name to userName |
| RemoveDiacritics(this string) | string | cafe from cafe |
| Mask(this string, int, int, char) | string | Masks middle characters |
| MaskEmail(this string) | string | Masks email local part |
| IsValidEmail(this string?) | bool | Validates email format |
| IsAlphanumeric(this string?) | bool | Only letters and digits |
| IsNumeric(this string?) | bool | Only digits |