zoukankan      html  css  js  c++  java
  • ASP.NET设置数据格式总结(二)[转]

    string.format格式结果


    String.Format

     (C) Currency: . . . . . . . . ($123.00)

    (D) Decimal:. . . . . . . . . -123

    (E) Scientific: . . . . . . . -1.234500E+002

    (F) Fixed point:. . . . . . . -123.45

    (G) General:. . . . . . . . . -123

    (N) Number: . . . . . . . . . -123.00

    (P) Percent:. . . . . . . . . -12,345.00 %

    (R) Round-trip: . . . . . . . -123.45

    (X) Hexadecimal:. . . . . . . FFFFFF85

    (d) Short date: . . . . . . . 6/26/2004

    (D) Long date:. . . . . . . . Saturday, June 26, 2004

    (t) Short time: . . . . . . . 8:11 PM

    (T) Long time:. . . . . . . . 8:11:04 PM

    (f) Full date/short time: . . Saturday, June 26, 2004 8:11 PM

    (F) Full date/long time:. . . Saturday, June 26, 2004 8:11:04 PM

    (g) General date/short time:. 6/26/2004 8:11 PM

    (G) General date/long time: . 6/26/2004 8:11:04 PM

    (M) Month:. . . . . . . . . . June 26

    (R) RFC1123:. . . . . . . . . Sat, 26 Jun 2004 20:11:04 GMT

    (s) Sortable: . . . . . . . . 2004-06-26T20:11:04

    (u) Universal sortable: . . . 2004-06-26 20:11:04Z (invariant)

    (U) Universal sortable: . . . Sunday, June 27, 2004 3:11:04 AM

    (Y) Year: . . . . . . . . . . June, 2004

    (G) General:. . . . . . . . . Green

    (F) Flags:. . . . . . . . . . Green (flags or integer)

    (D) Decimal number: . . . . . 3

    (X) Hexadecimal:. . . . . . . 00000003

     

    说明:
    String.Format
    将指定的 String 中的每个格式项替换为相应对象的值的文本等效项。

    例子:

    int iVisit = 100;
    string szName = "Jackfled";
    Response.Write(String.Format("
    您的帐号是:{0} 。访问了 {1} .", szName, iVisit));

  • 相关阅读:
    NPAPI插件开发记录(一) .rc文件 支持Chrome和FireFox
    C语言实现数组快速排序(含对算法的详细解释)
    VBA Address expression
    一起学习winphone7开发系列课程 by 李振
    Performance and memory profiler JefBrains dotTrace tool
    WPF自学教程系列2:如何在xaml文件添加引用?
    for foreach 效率比较
    20130131. CLR C++
    C++ XML编程
    c++ 内存泄露检测
  • 原文地址:https://www.cnblogs.com/ghx88/p/466548.html
Copyright © 2011-2022 走看看