BO4E/EnergyIdentificationCodes/EnergyIdentificationCodeExtensions.cs
/// <summary>
/// converts the character <paramref name="character"/> to a number according to the ENTSO-E/EIC algorithm
/// </summary>
/// <param name="character"></param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException">if the character is not A-Z or "-"</exception>
converts the character  to a number according to the ENTSO-E/EIC algorithm
converts the character to a number according to the ENTSO - E / EIC algorithm
private static int CharacterToNumberEic(char character)
        {
            if (character == '-')
            {
                return 36;
            }
            return character switch
            {
                '0' => 0,
                '1' => 1,
                '2' => 2,
                '3' => 3,
                '4' => 4,
                '5' => 5,
                '6' => 6,
                '7' => 7,
                '8' => 8,
                '9' => 9,
                _ => character - 55 
            };
        }
private static int CharacterToNumberEic ( char character ) { if ( character == ' ' ) { return 36 ; } return character switch { ' ' => 0 , ' ' => 1 , ' ' => 2 , ' ' => 3 , ' ' => 4 , ' ' => 5 , ' ' => 6 , ' ' => 7 , ' ' => 8 , ' ' => 9 , _ => character - 55 } ; }
converts the character  to a number according to the ENTSO-E/EIC algorithm
converts the character to a number according to the ENTSO - E / EIC algorithm
// in ASCII 65=A but in ENTSO 10=A
None
if the character is not A-Z or "-"
if the character is not A - Z or " - "
character
char
None