zoukankan      html  css  js  c++  java
  • string Format转义大括号:输入字符串的格式不正确。

    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!
  • 相关阅读:
    Web框架本质及浅谈HTTP协议
    mysql
    jQuery
    Css
    html
    socket编程
    面向对象and类
    模块
    装饰器
    cef network-settings
  • 原文地址:https://www.cnblogs.com/gosky/p/4974553.html
Copyright © 2011-2022 走看看