-
Notifications
You must be signed in to change notification settings - Fork 5
Version 8.x.x TrimOrNullify
Pawel Gerr edited this page Aug 21, 2025
·
1 revision
Convenience method for trimming, truncating and nullifying of string.
- If string is empty or containing whitespace only, then the method returns
null. - Otherwise the
stringis trimmed - If parameter
maxLengthis provided then thestringwill be shortened if necessary.
string value = ...;
var trimmedOrNull = value.TrimOrNullify();
var trimmedAndShortenedOrNull = value.TrimOrNullify(maxLength: 10);- Home
- Smart Enums
- Value Objects
- Discriminated Unions
- Object Factories
- Analyzer Diagnostics
- Source Generator Configuration
- Convenience methods and classes
- Migrations
- Version 7
- Version 8