plz帮助c#中的简单方法 [英] plz help simple methods in c#

查看:94
本文介绍了plz帮助c#中的简单方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们





我想知道这部分{0}在此方法中的作用是什么?





Hey guys


I wanna know what does zero this part {0} do in this method ???


public string HelloUser(string Name)
      {
          return string.Format("Hello {0}", Name);
      }

推荐答案

它是一个占位符,Name变量在运行时放置。您可以使用{1},{2}等添加其他参数。
Its a place holder that the "Name" variable gets placed at run time. You can add additional parameters by using {1}, {2}, etc.


尝试阅读 String.Format [ ^ ]。


这篇关于plz帮助c#中的简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆