手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >asp.net String.format中大括号的加入方法
asp.net String.format中大括号的加入方法
摘要:复制代码代码如下:String.Format("{0}world!","hello")//将输出helloworld!,没有问题,但是只要在...

复制代码 代码如下:

String.Format("{0} world!","hello") //将输出 hello world!,没有问题,但是只要在第一个参数的任意位置加上一个大括号:

String.Format("{0} wo{rld!","hello") //就会产生一个异常,异常信息是:Input string was not in a correct format.

//解决办法:String.Format("{0} wo{{rld!","hello")

//or

String.Format("{0} wo{1}rld!","hello","{")

//它们都将输出 hello wo{rld!

【asp.net String.format中大括号的加入方法】相关文章:

asp.net为网页动态添加关键词的方法

asp.net下Request.QueryString取不到值的解决方法

在asp.net下实现Option条目中填充前导空格的方法

asp.net下URL处理两个小工具方法

asp.net获取HTML表单File中的路径的方法

asp.net GridView的删除对话框的两种方法

asp.net操作javascript:confirm返回值的两种方式

ASP.Net下载大文件的实现方法

asp.net OleDbCommand 的用法

asp.net中List的使用方法

精品推荐
分类导航