How can I create a more user-friendly string.format syntax?

前端 未结 6 2002
慢半拍i
慢半拍i 2020-11-27 10:29

I need to create a very long string in a program, and have been using String.Format. The problem I am facing is keeping track of all the numbers when you have more than 8-10

6条回答
  •  无人及你
    2020-11-27 11:10

    What about if age/name is an variable in your application. So you would need a sort syntax to make it almost unique like {age_1}?

    If you have trouble with 8-10 parameters: why don't use

    "You are " + age + " years old and your last name is " + name + "
    

提交回复
热议问题