请问如下代码中?:{0:d}和{0:string str1=String.Format("(d)Short date:{0:d}\n",DateTime.Now);string str2 =String.Format("(C)Currency:{0:C}\n",89.0f);

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 11:04:21
请问如下代码中?:{0:d}和{0:stringstr1=String.Format("(d)Shortdate:{0:d}\n",DateTime.Now);stringstr2=String.Fo

请问如下代码中?:{0:d}和{0:string str1=String.Format("(d)Short date:{0:d}\n",DateTime.Now);string str2 =String.Format("(C)Currency:{0:C}\n",89.0f);
请问如下代码中?:{0:d}和{0:
string str1=String.Format("(d)Short date:{0:d}\n",DateTime.Now);
string str2 =String.Format("(C)Currency:{0:C}\n",89.0f);

请问如下代码中?:{0:d}和{0:string str1=String.Format("(d)Short date:{0:d}\n",DateTime.Now);string str2 =String.Format("(C)Currency:{0:C}\n",89.0f);
格式化字符
{0:d} 应该是转化成日期型
{0:C}应该是转化成货币型