Some Useful Examples(String.Format)
2012-09-25 11:19
246 查看
Some Useful Examples
String.Format("{0:$#,##0.00;($#,##0.00);Zero}", value);This will output "$1,240.00" if passed 1243.50. It will output the same format but in parentheses if the number is negative, and will output the string "Zero" if the number is zero.
String.Format("{0:(###) ###-####}", 18005551212);
This will output "(800) 555-1212".
相关文章推荐
- Java String.Format() 方法及参数说明
- ASP.NET C# String.Format格式化输出
- ASP.NET设置数据格式与String.Format使用总结
- String.format字符串格式化方法
- JAVA字符串格式化-String.format()的使用
- c++ 字符串格式 String Format 库 (替代printf)
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- iOS: NSString应该用initWithFormat? 还是 stringWithFormat?
- [筆記] string.Format 格式整理
- string.Format
- string.Format 格式化时间,货币
- String.format 详解
- String.format()方法使用说明
- Trim()和String.Format
- String.Format 摘录
- GridView日期列使用DataFormatString格式化技巧
- struts2,hibernate java.lang.NumberFormatException: For input string 错误
- 在string.xml文件中定义一个字符串,然后在代码中通过String.format方法来格式化该字符串
- lua的string.format为什么比".."慢
- .NET C# Tostring() format 格式化字符串大全