code: public static char getMnemonic(String label) {
      int mnemonicPos = label.indexOf('&');
      while (mnemonicPos != -1 && mnemonicPos == label.indexOf("&&")
              && mnemonicPos < label.length()) {
        mnemonicPos = label.indexOf('&', mnemonicPos + 2);
      }
      if (mnemonicPos == -1 || mnemonicPos == label.length()) {
        return '\u0000';
      }
      return label.charAt(mnemonicPos + 1);
    }
docs: Returns mnemonic of a UI element.
  
  @param label String Label of the UI element
  @return Mnemonic of the UI element, or {@code \u0000} in case of no mnemonic set.