Class IdentifierNormalizer
Utility class for normalizing identifier values to ensure consistent storage and comparison. Strips dashes and spaces to produce a canonical form.
public static class IdentifierNormalizer
- Inheritance
-
objectIdentifierNormalizer
Methods
Normalize(string)
Normalizes an identifier by trimming whitespace and removing dashes and spaces.
public static string Normalize(string value)
Parameters
valuestringThe identifier to normalize.
Returns
- string
The normalized identifier.
Exceptions
- ArgumentException
Thrown when the identifier is null or whitespace.
NormalizeOrNull(string?)
Normalizes an identifier by trimming whitespace and removing dashes and spaces, or returns null if the input is null or whitespace.
public static string? NormalizeOrNull(string? value)
Parameters
valuestringThe identifier to normalize, or null/whitespace.
Returns
- string
The normalized identifier, or null if the input was null or whitespace.