TextWithMnemonic (boolean forceRemove) { if (!hasMnemonic()) return this; if (!forceRemove) return fromPlainText(text); Matcher matcher = MNEMONIC.matcher(text); if (matcher.find()) { //noinspection HardCodedStringLiteral return fromPlainText(matcher.replaceAll("")); } return this; }