Search code examples
intellij-ideainputkeyboardsymbolsdisplay

How to input a check mark into IDEA only by using keyboard instead copying from website? For example the check mark is ✓ or ✗


I get the ✓ and ✗ from website. I want to input them only by keyboard. How I deal with it? enter image description here


Solution

  • You could just use Unicode hex value inside your println statement:

    System.out.println(se.execute() == 1 +2 * (9 - 5) ? "\u2713" : "\u2717");
    

    \u2713 is ✓

    \u2717 is ✗

    Also, It's possible to put such types of symbols by using keyboard shortcuts:

    E.g. in Windows: Alt +2713 and Alt +2717