string.Format( "{0}", expr )
我们知道{0}是一个站位符, 但是如果我想输入字符串 "{ element:value }"
就用string.Format( "{ {0}:{1} }", element, value );
这样不行?如何才能做到?
"{" 用"{{"代替就可以了
string.Format( "{{ {0}:{1} }}", element, value );
string a =string.Format( "{0}{1}:{2}{3}", "{",element, value,"}");
or
string.Format( "{{{0}:{1} }}", element, value );//刚学的,分数给楼上两位;