Method IsValidName
IsValidName(ReadOnlySpan<char>)
Returns true when name is a valid simple name:
it starts with [A-Za-z_] and continues with [A-Za-z0-9_].
The same rule applies to record field names and enum symbols.
public static bool IsValidName(ReadOnlySpan<char> name)
Parameters
nameReadOnlySpan<char>The name to check.