code: public static function clean($currencyCode)
      {
          $clean = trim(strtoupper($currencyCode));
  
          if (!self::exists($clean)) {
              throw new UnknownCurrencyCodeException(sprintf('Unknown currency code "%s".', $currencyCode));
          }
  
          return $clean;
      }
docs: Clean currency code
  
  @param string $currencyCode Currency code to clean up.
  @return string Cleaned ISO 4271 currency code.
  @throws UnknownCurrencyCodeException If currency code does not exists.