c# switch statement is return suitable to replace break

后端 未结 2 1191
刺人心
刺人心 2020-12-09 15:04

Is this an appropriate way to handle c# switch statements or is an explicit break required still? reference

  public static string ToRegistryString(AliceK         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-09 15:54

    You do not need to specifically use a break statement just one that changes the flow of control, so a goto or a return should work.

    See MSDN for more info: http://msdn.microsoft.com/en-us/library/06tc147t(VS.71).aspx

提交回复
热议问题