IdentifierCase Enum
Definition
Identifies which casing convention ToIdentifier(string, IdentifierCase) applies to the words detected in the source string after invalid identifier characters have been stripped.
public enum IdentifierCase
- Extension Methods
Fields
Preserve = 0Preserves each word's original casing and concatenates them with no separator.
Camel = 1Lower-cases the first word and capitalises subsequent words (
userAccountId).Pascal = 2Capitalises every word (
UserAccountId).Snake = 3Lower-cases every word and joins with underscores (
user_account_id).
Remarks
The detected words follow the same boundary rules as the other casing helpers (camelCase / PascalCase transitions, digit transitions, and the standard separator set). Selecting Preserve keeps each word's existing casing and joins them with no separator, which is the behaviour required when the source already obeys an identifier convention and only invalid characters need to be removed.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |