How to automatically convert if-else if statement to switch

前端 未结 7 2400
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 15:23

Is there a hot key or easy way to replace an if-else if statement with a switch in IntelliJ? I would prefer not to manually convert the if-else if statement to a switch. I

7条回答
  •  天命终不由人
    2020-12-15 16:03

    Android studio (intelliJ idea):

    Put your cursor on the switch/if statement and:

    mac: option + return

    win: alt + enter

提交回复
热议问题