自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

淺析C# Format函數(shù)

開發(fā) 后端
本文介紹C# Format函數(shù)的語法具有幾個部分:expression 必要參數(shù),format 可選參數(shù),firstdayofweek 可選參數(shù)和firstweekofyear 可選參數(shù)。

C# Format函數(shù) 返回

返回 Variant (String),其中含有一個表達(dá)式,它是根據(jù)格式表達(dá)式中的指令來格式化的。

語法

Format(expression[, format[, firstdayofweek[, firstweekofyear]]])

C# Format函數(shù)的語法具有下面幾個部分:

部分 說明
expression 必要參數(shù)。任何有效的表達(dá)式。
format 可選參數(shù)。有效的命名表達(dá)式或用戶自定義格式表達(dá)式。

firstdayofweek 可選參數(shù)。常數(shù),表示一星期的***天。
firstweekofyear 可選參數(shù)。常數(shù),表示一年的***周。

C# Format函數(shù)可按預(yù)定的格式顯示或打印一個Date變量。如:
Print Format(d, “general date”) `99-5-23 11:45:34
Print Format(d, “l(fā)ong date”) `1999年5月23日
Print Format(d, “medium date”) `99-05-23
Print Format(d, “short date”) `99-5-23
Print Format(d, “l(fā)ong time”) `11:45:34
Print Format(d, “medium time”) `11:4***M
Print Format(d,“short time”) `11:45

C# Format函數(shù)也允許你自己規(guī)定顯示格式。

【編輯推薦】

  1. C#在應(yīng)用程序間發(fā)送消息實現(xiàn)淺析
  2. 一些C#時間類型的入門知識
  3. C#接口和抽象類技術(shù)特點淺析
  4. 一個C#時間計算的實例
  5. C#繼承知識詳解
責(zé)任編輯:佚名 來源: 比特網(wǎng)
相關(guān)推薦

2009-08-10 14:43:03

C#函數(shù)Convert

2009-07-31 16:00:30

C#函數(shù)重載

2009-07-31 15:22:56

C#判等函數(shù)

2009-08-14 09:15:28

C#調(diào)用構(gòu)造函數(shù)

2009-07-31 15:44:02

C#靜態(tài)構(gòu)造函數(shù)

2009-08-13 18:15:06

C#繼承構(gòu)造函數(shù)

2009-08-13 17:38:42

C#構(gòu)造函數(shù)

2009-09-18 09:02:45

CLR Via C#

2009-08-13 18:02:11

C#靜態(tài)構(gòu)造函數(shù)

2009-08-14 09:43:59

C#復(fù)制構(gòu)造函數(shù)

2009-08-14 09:58:09

C#復(fù)制構(gòu)造函數(shù)

2009-08-13 13:42:54

C#構(gòu)造函數(shù)

2009-08-13 17:30:30

C#構(gòu)造函數(shù)

2009-08-14 17:45:52

C# ArrayLis

2009-08-17 18:34:50

C# ChangeCo

2009-08-07 17:25:37

C# SortedLi

2009-08-13 18:36:36

C#繼承構(gòu)造函數(shù)

2009-07-31 16:25:29

C#回調(diào)函數(shù)API應(yīng)用

2009-08-25 17:59:49

C#入門

2009-08-18 10:30:30

C#枚舉
點贊
收藏

51CTO技術(shù)棧公眾號