Declare and assign multiple string variables at the same time

前端 未结 10 2292
醉话见心
醉话见心 2020-12-08 13:03

I\'m declaring some strings that are empty, so it won\'t throw errors later on.

I\'ve read that this was the proper way:

string Camnr = Klantnr = Ord         


        
10条回答
  •  感动是毒
    2020-12-08 13:24

    You can to do it this way:

    string Camnr = "", Klantnr = "", ... // or String.Empty
    

    Or you could declare them all first and then in the next line use your way.

提交回复
热议问题