源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

asp.net String.format中大括号的加入方法

  • 时间:2020-08-17 19:54 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:asp.net String.format中大括号的加入方法
[u]复制代码[/u] 代码如下:
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!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部