void (PsiLiteralExpression literal) { final String text = literal.getText(); final int max = text.length() - (PsiTypes.longType().equals(literal.getType()) ? 2 : 1); if (max < 1) { return; } int index = 0; while (index < max && (text.charAt(index) == '0' || text.charAt(index) == '_')) { index++; } final String textWithoutLeadingZeros = text.substring(index); PsiReplacementUtil.replaceExpression(literal, textWithoutLeadingZeros); }