# C# 中的字符串
> 原文: [https://zetcode.com/lang/csharp/strings/](https://zetcode.com/lang/csharp/strings/)
在 C# 教程的這一部分中,我們將更詳細地處理字符串數據。 字符串在計算機語言中非常重要。 這就是為什么我們將整章專門用于 C# 中的字符串的原因。
## C# 字符串定義
字符串是字符序列。 在 C# 中,字符串是 Unicode 字符序列。 它是一種數據類型,用于存儲一系列數據值(通常為字節),其中元素通常根據字符編碼代表字符。 當字符串從字面上出現在源代碼中時,稱為字符串字面值。
字符串是對象。 有兩個用于處理字符串的基本類:
* `System.String`
* `System.Text.StringBuilder`
`String`是不可變的字符序列。 `StringBuilder`是可變的字符序列。
在 C# 中,`string`是`System.String`的別名。 `string`是語言關鍵字,`System.String`是.NET 類型。
## C# 初始化字符串
有多種創建字符串的方法,它們都是不可變的和可變的。 我們將展示其中的一些。
`Program.cs`
```cs
using System;
using System.Text;
namespace Initialization
{
class Program
{
static void Main(string[] args)
{
char[] cdb = { 'M', 'y', 'S', 'q', 'l' };
string lang = "C#";
String ide = "NetBeans";
string db = new string(cdb);
Console.WriteLine(lang);
Console.WriteLine(ide);
Console.WriteLine(db);
StringBuilder sb1 = new StringBuilder(lang);
StringBuilder sb2 = new StringBuilder();
sb2.Append("Fields");
sb2.Append(" of ");
sb2.Append("glory");
Console.WriteLine(sb1);
Console.WriteLine(sb2);
}
}
}
```
該示例顯示了創建`System.String`和`System.Text.StringBuilder`對象的幾種方法。
```cs
using System.Text;
```
該語句可以不加限制地使用`System.Text.StringBuilder`類型。
```cs
string lang = "C#";
String ide = "NetBeans";
```
最常見的方法是根據字符串字面值創建字符串對象。
```cs
string db = new string(cdb);
```
在這里,我們從字符數組創建一個字符串對象。 `string`是`System.String`的別名。
```cs
StringBuilder sb1 = new StringBuilder(lang);
```
從`String`創建一個`StringBuilder`對象。
```cs
StringBuilder sb2 = new StringBuilder();
sb2.Append("Fields");
sb2.Append(" of ");
sb2.Append("glory");
```
我們創建一個空的`StringBuilder`對象。 我們將三個字符串附加到對象中。
```cs
$ dotnet run
C#
NetBeans
MySql
C#
Fields of glory
```
運行示例可得出此結果。
## C# 字符串插值
$特殊字符前綴將字符串字面值標識為插值字符串。 插值字符串是可能包含插值表達式的字符串字面值。
字符串格式化與字符串插值相似。 本章后面將介紹它。
`Program.cs`
```cs
using System;
namespace Interpolation
{
class Program
{
static void Main(string[] args)
{
int age = 23;
string name = "Peter";
DateTime now = DateTime.Now;
Console.WriteLine($"{name} is {age} years old");
Console.WriteLine($"Hello, {name}! Today is {now.DayOfWeek},
it's {now:HH:mm} now");
}
}
}
```
該示例介紹了 C# 字符串插值。
```cs
Console.WriteLine($"{name} is {age} years old");
```
內插變量位于{}括號之間。
```cs
Console.WriteLine($"Hello, {name}! Today is {now.DayOfWeek},
it's {now:HH:mm} now");
```
插值語法可以接收表達式或格式說明符。
```cs
$ dotnet run
Peter is 23 years old
Hello, Peter! Today is Friday, it's 14:58 now
```
這是輸出。
## C# 常規字符串
常規字符串可以包含解釋的轉義序列,例如換行符或制表符。 常規字符串放在一對雙引號之間。
`Program.cs`
```cs
using System;
using System.Text;
namespace RegularLiterals
{
class Program
{
static void Main(string[] args)
{
string s1 = "deep \t forest";
string s2 = "deep \n forest";
Console.WriteLine(s1);
Console.WriteLine(s2);
Console.WriteLine("C:\\Users\\Admin\\Documents");
}
}
}
```
該示例打印兩個包含`\t`和`\n`轉義序列的字符串。
```cs
Console.WriteLine("C:\\Users\\Admin\\Documents");
```
使用路徑時,必須避開陰影。
```cs
$ dotnet run
deep forest
deep
forest
C:\Users\Admin\Documents
```
This is the output.
## C# 逐字字符串
逐字字符串不解釋轉義序列。 逐字字符串以`@`字符開頭。 逐字字符串可用于多行字符串。
`Program.cs`
```cs
using System;
namespace VerbatimLiterals
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(@"deep \t forest");
Console.WriteLine(@"C:\Users\Admin\Documents");
var text = @"
Not marble, nor the gilded monuments
Of princes, shall outlive this powerful rhyme;
But you shall shine more bright in these contents
Than unswept stone, besmeared with sluttish time.";
Console.WriteLine(text);
}
}
}
```
在此代碼示例中,我們使用逐字字符串。
```cs
Console.WriteLine(@"deep \t forest");
```
`\t`特殊字符不被解釋; 它僅打印到控制臺。
```cs
Console.WriteLine(@"C:\Users\Admin\Documents");
```
使用路徑時,逐字字符串很方便; 不必逃避陰影。
```cs
var text = @"
Not marble, nor the gilded monuments
Of princes, shall outlive this powerful rhyme;
But you shall shine more bright in these contents
Than unswept stone, besmeared with sluttish time.";
```
逐字字符串允許我們創建多行字符串。
```cs
$ dotnet run
deep \t forest
C:\Users\Admin\Documents
Not marble, nor the gilded monuments
Of princes, shall outlive this powerful rhyme;
But you shall shine more bright in these contents
Than unswept stone, besmeared with sluttish time.
```
This is the output.
## C# 字符串是對象
字符串是對象。 它們是引用類型。 字符串是`System.String`或`System.Text.StringBuilder`類的實例。 由于它們是對象,因此有多種方法可用于完成各種工作。
`Program.cs`
```cs
using System;
namespace Objects
{
class Program
{
static void Main(string[] args)
{
string lang = "Java";
string bclass = lang.GetType().Name;
Console.WriteLine(bclass);
string parclass = lang.GetType().BaseType.Name;
Console.WriteLine(parclass);
if (lang.Equals(String.Empty))
{
Console.WriteLine("The string is empty");
}
else
{
Console.WriteLine("The string is not empty");
}
int len = lang.Length;
Console.WriteLine("The string has {0} characters", len);
}
}
}
```
在此程序中,我們演示了字符串是對象。 對象必須具有一個類名,一個父類,并且還必須具有一些我們可以調用的方法或要訪問的屬性。
```cs
string lang = "Java";
```
創建`System.String`類型的對象。
```cs
string bclass = lang.GetType().Name;
Console.WriteLine(bclass);
```
我們確定`lang`變量所引用的對象的類名稱。
```cs
string parclass = lang.GetType().BaseType.Name;
Console.WriteLine(parclass);
```
接收到我們對象的父類。 所有對象都有至少一個父對象-`Object`。
```cs
if (lang.Equals(String.Empty))
{
Console.WriteLine("The string is empty");
} else
{
Console.WriteLine("The string is not empty");
}
```
對象具有各種方法。 使用`Equals()`方法,我們檢查字符串是否為空。
```cs
int len = lang.Length;
Console.WriteLine("The string has {0} characters", len);
```
`Length()`方法返回字符串的大小。
```cs
$ dotnet run
String
Object
The string is not empty
The string has 4 characters
```
這是`stringobjects.exe`程序的輸出。
## C# 可變&不可變字符串
`String`是不可變字符序列,而`StringBuilder`是可變字符序列。 下一個示例將顯示差異。
`Program.cs`
```cs
using System;
using System.Text;
namespace MutableImmutable
{
class Program
{
static void Main(string[] args)
{
string name = "Jane";
string name2 = name.Replace('J', 'K');
string name3 = name2.Replace('n', 't');
Console.WriteLine(name);
Console.WriteLine(name3);
StringBuilder sb = new StringBuilder("Jane");
Console.WriteLine(sb);
sb.Replace('J', 'K', 0, 1);
sb.Replace('n', 't', 2, 1);
Console.WriteLine(sb);
}
}
}
```
這兩個對象都有替換字符串中字符的方法。
```cs
string name = "Jane";
string name2 = name.Replace('J', 'K');
string name3 = name2.Replace('n', 't');
```
在`String`上調用`Replace()`方法將導致返回新的修改后的字符串。 原始字符串不變。
```cs
sb.Replace('J', 'K', 0, 1);
sb.Replace('n', 't', 2, 1);
```
`StringBuilder`的`Replace()`方法將用新字符替換給定索引處的字符。 原始字符串被修改。
```cs
$ dotnet run
Jane
Kate
Jane
Kate
```
這是程序的輸出。
## C# 連接字符串
可以使用`+`運算符或`Concat()`方法添加不可變的字符串。 它們將形成一個新字符串,該字符串是所有連接字符串的鏈。 可變字符串具有`Append()`方法,該方法可以從任意數量的其他字符串中構建一個字符串。
也可以使用字符串格式設置和插值來連接字符串。
`Program.cs`
```cs
using System;
using System.Text;
namespace Concatenate
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Return" + " of " + "the king.");
Console.WriteLine(string.Concat(string.Concat("Return", " of "),
"the king."));
StringBuilder sb = new StringBuilder();
sb.Append("Return");
sb.Append(" of ");
sb.Append("the king.");
Console.WriteLine(sb);
string s1 = "Return";
string s2 = "of";
string s3 = "the king.";
Console.WriteLine("{0} {1} {2}", s1, s2, s3);
Console.WriteLine($"{s1} {s2} {s3}");
}
}
}
```
該示例通過連接字符串創建五個句子。
```cs
Console.WriteLine("Return" + " of " + "the king.");
```
通過使用+運算符形成一個新的字符串。
```cs
Console.WriteLine(string.Concat(string.Concat("Return", " of "),
"the king."));
```
`Concat()`方法連接兩個字符串。 該方法是`System.String`類的靜態方法。
```cs
StringBuilder sb = new StringBuilder();
sb.Append("Return");
sb.Append(" of ");
sb.Append("the king.");
```
通過三次調用`Append()`方法來創建`StringBuilder`類型的可變對象。
```cs
Console.WriteLine("{0} {1} {2}", s1, s2, s3);
```
字符串以字符串格式形成。
```cs
Console.WriteLine($"{s1} {s2} {s3}");
```
最后,使用插值語法添加字符串。
```cs
$ dotnet run
Return of the king.
Return of the king.
Return of the king.
Return of the king.
Return of the king.
```
這是示例輸出。
## C# 使用引號
當我們要顯示引號時,例如在直接語音中,必須對內引號進行轉義。
`Program.cs`
```cs
using System;
namespace Quotes
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("There are many stars.");
Console.WriteLine("He said, \"Which one is your favourite?\"");
Console.WriteLine(@"
Lao Tzu has said:
""If you do not change direction, you may end up
where you are heading.""
");
}
}
}
```
本示例打印直接語音。
```cs
Console.WriteLine("He said, \"Which one is your favourite?\"");
```
在常規字符串中,該字符使用`\`進行轉義。
```cs
Console.WriteLine(@"
Lao Tzu has said:
""If you do not change direction, you may end up
where you are heading.""
");
```
在逐字字符串中,引號前面帶有另一個引號。
```cs
$ dotnet run
There are many stars.
He said, "Which one is your favourite?"
Lao Tzu has said: "If you do not change direction, you may end up
where you are heading."
```
This is the output of the program.
## C# 比較字符串
我們可以使用`==`運算符比較兩個字符串。
`Program.cs`
```cs
using System;
namespace CompareString
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("12" == "12");
Console.WriteLine("17" == "9");
Console.WriteLine("aa" == "ab");
}
}
}
```
在示例程序中,我們比較字符串。
```cs
$ dotnet run
True
False
False
```
這是程序的輸出。
`string.Compare()`方法比較兩個指定的字符串,并返回一個整數,該整數指示排序順序中它們的相對位置。 如果返回的值小于零,則第一個字符串小于第二個字符串。 如果返回零,則兩個字符串相等。 最后,如果返回的值大于零,則第一個字符串大于第二個字符串。
`Program.cs`
```cs
using System;
namespace CompareString2
{
class Program
{
static void Main(string[] args)
{
string str1 = "ZetCode";
string str2 = "zetcode";
Console.WriteLine(string.Compare(str1, str2, true));
Console.WriteLine(string.Compare(str1, str2, false));
}
}
}
```
有一個可選的第三個`ignoreCase`參數。 它確定是否應履行此案。
```cs
Console.WriteLine(string.Compare(str1, str2, true));
```
比較兩個字符串并忽略大小寫。 此行將 0 打印到控制臺。
## C# 字符串元素
字符串是字符序列。 字符是字符串的基本元素。
`Program.cs`
```cs
using System;
namespace StringElements
{
class Program
{
static void Main(string[] args)
{
char[] crs = { 'Z', 'e', 't', 'C', 'o', 'd', 'e' };
String s = new String(crs);
char c1 = s[0];
char c2 = s[(s.Length - 1)];
Console.WriteLine(c1);
Console.WriteLine(c2);
int i1 = s.IndexOf('e');
int i2 = s.LastIndexOf('e');
Console.WriteLine("The first index of character e is " + i1);
Console.WriteLine("The last index of character e is " + i2);
Console.WriteLine(s.Contains("t"));
Console.WriteLine(s.Contains("f"));
char[] elements = s.ToCharArray();
foreach (char el in elements)
{
Console.WriteLine(el);
}
}
}
}
```
在第一個示例中,我們將使用不可變的字符串。
```cs
char[] crs = {'Z', 'e', 't', 'C', 'o', 'd', 'e' };
String s = new String(crs);
```
由字符數組構成一個新的不可變字符串。
```cs
char c1 = s[0];
char c2 = s[(s.Length-1)];
```
使用數組訪問符號,我們獲得字符串的第一個和最后一個`char`值。
```cs
int i1 = s.IndexOf('e');
int i2 = s.LastIndexOf('e');
```
通過上述方法,我們得到了字符`"e"`的第一個和最后一個出現。
```cs
Console.WriteLine(s.Contains("t"));
Console.WriteLine(s.Contains("f"));
```
使用`Contains()`方法,我們檢查字符串是否包含't'字符。 該方法返回一個布爾值。
```cs
char[] elements = s.ToCharArray();
foreach (char el in elements)
{
Console.WriteLine(el);
}
```
`ToCharArray()`方法從字符串創建一個字符數組。 我們遍歷數組并打印每個字符。
```cs
$ dotnet run
Z
e
The first index of character e is 1
The last index of character e is 6
True
False
Z
e
t
C
o
d
e
```
This is the example output.
在第二個示例中,我們將使用可變字符串的元素。
`Program.cs`
```cs
using System;
using System.Text;
public class StringBuilderElements
{
static void Main()
{
StringBuilder sb = new StringBuilder("Misty mountains");
Console.WriteLine(sb);
sb.Remove(sb.Length-1, 1);
Console.WriteLine(sb);
sb.Append('s');
Console.WriteLine(sb);
sb.Insert(0, 'T');
sb.Insert(1, 'h');
sb.Insert(2, 'e');
sb.Insert(3, ' ');
Console.WriteLine(sb);
sb.Replace('M', 'm', 4, 1);
Console.WriteLine(sb);
}
}
```
形成可變的字符串。 我們通過刪除,附加,插入和替換字符來修改字符串的內容。
```cs
sb.Remove(sb.Length-1, 1);
```
這行刪除最后一個字符。
```cs
sb.Append('s');
```
刪除的字符將附加回字符串。
```cs
sb.Insert(0, 'T');
sb.Insert(1, 'h');
sb.Insert(2, 'e');
sb.Insert(3, ' ');
```
我們在字符串的開頭插入四個字符。
```cs
sb.Replace('M', 'm', 4, 1);
```
最后,我們在索引 4 處替換一個字符。
```cs
$ dotnet run
Misty mountains
Misty mountain
Misty mountains
The Misty mountains
The misty mountains
```
從輸出中,我們可以看到可變字符串是如何變化的。
## C# 字符串連接和拆分
`Join()`連接字符串,`Split()`拆分字符串。
`Program.cs`
```cs
using System;
namespace JoinSplit
{
class Program
{
static void Main(string[] args)
{
var items = new string[] { "C#", "Visual Basic", "Java", "Perl" };
var langs = string.Join(",", items);
Console.WriteLine(langs);
string[] langs2 = langs.Split(',');
foreach (string lang in langs2)
{
Console.WriteLine(lang);
}
}
}
}
```
在我們的程序中,我們將連接和分割字符串。
```cs
var items = new string[] { "C#", "Visual Basic", "Java", "Perl" };
```
這是一個字符串數組。 這些字符串將被連接。
```cs
string langs = string.Join(",", items);
```
數組中的所有單詞都被加入。 我們從中構建一個字符串。 每兩個字之間會有一個逗號。
```cs
string[] langs2 = langs.Split(',');
```
作為反向操作,我們分割了`langs`字符串。 `Split()`方法返回由字符分隔的單詞數組。 在我們的情況下,它是一個逗號字符。
```cs
foreach (string lang in langs2)
{
Console.WriteLine(lang);
}
```
我們遍歷數組并打印其元素。
```cs
$ dotnet run
C#,Visual Basic,Java,Perl
C#
Visual Basic
Java
Perl
```
這是示例的輸出。
## C# 常用方法
接下來,我們介紹了幾個其他的常見字符串方法。
`Program.cs`
```cs
using System;
namespace CommonMethods
{
class Program
{
static void Main(string[] args)
{
string word = "Determination";
Console.WriteLine(word.Contains("e"));
Console.WriteLine(word.IndexOf("e"));
Console.WriteLine(word.LastIndexOf("i"));
Console.WriteLine(word.ToUpper());
Console.WriteLine(word.ToLower());
}
}
}
```
在上面的示例中,我們介紹了五個字符串方法。
```cs
Console.WriteLine(str.Contains("e"));
```
如果字符串包含特定字符,則`Contains()`方法返回`True`。
```cs
Console.WriteLine(str.IndexOf("e"));
```
`IndexOf()`返回字符串中字母的第一個索引。
```cs
Console.WriteLine(str.LastIndexOf("i"));
```
`LastIndexOf()`方法返回字符串中字母的最后一個索引。
```cs
Console.WriteLine(str.ToUpper());
Console.WriteLine(str.ToLower());
```
字符串的字母通過`ToUpper()`方法轉換為大寫,并通過`ToLower()`方法轉換為小寫。
```cs
$ dotnet run
True
1
10
DETERMINATION
determination
```
運行程序。
## C# 字符串復制與克隆
我們將描述兩種方法之間的區別:`Copy()`和`Clone()`。 `Copy()`方法創建一個新字符串實例,該實例的值與指定的字符串相同。 `Clone()`方法返回對正在克隆的字符串的引用。 它不是堆上字符串的獨立副本。 它是同一字符串上的另一個引用。
`Program.cs`
```cs
using System;
namespace CopyClone
{
class Program
{
static void Main(string[] args)
{
string str = "ZetCode";
string cloned = (string) str.Clone();
string copied = string.Copy(str);
Console.WriteLine(str.Equals(cloned)); // prints True
Console.WriteLine(str.Equals(copied)); // prints True
Console.WriteLine(ReferenceEquals(str, cloned)); // prints True
Console.WriteLine(ReferenceEquals(str, copied)); // prints False
}
}
}
```
我們的示例演示了兩種方法之間的區別。
```cs
string cloned = (string) str.Clone();
string copied = string.Copy(str);
```
字符串值被克隆并復制。
```cs
Console.WriteLine(str.Equals(cloned)); // prints True
Console.WriteLine(str.Equals(copied)); // prints True
```
`Equals()`方法確定兩個字符串對象是否具有相同的值。 所有三個字符串的內容都是相同的。
```cs
Console.WriteLine(ReferenceEquals(str, cloned)); // prints True
Console.WriteLine(ReferenceEquals(str, copied)); // prints False
```
`ReferenceEquals()`方法比較兩個引用對象。 因此,將復制的字符串與原始字符串進行比較將返回`false`。 因為它們是兩個不同的對象。
## C# 格式化字符串
在下面的示例中,我們將格式化字符串。 .NET Framework 具有稱為復合格式的功能。 `Format()`和`WriteLine()`方法支持它。 方法采用對象列表和復合格式字符串作為輸入。 格式字符串由固定字符串和一些格式項組成。 這些格式項是與列表中的對象相對應的索引占位符。
格式項具有以下語法:
```cs
{index[,length][:formatString]}
```
索引組件是必需的。 它是一個從 0 開始的數字,表示對象列表中的一項。 多個項目可以引用對象列表的同一元素。 如果格式項未引用該對象,則將其忽略。 如果我們在對象列表的范圍之外引用,則會拋出運行時異常。
長度部分是可選的。 它是參數的字符串表示形式中的最小字符數。 如果為正,則該參數為右對齊;否則為 0。 如果為負,則為左對齊。 如果指定,則必須用冒號分隔索引和長度。
`formatString`是可選的。 它是一個格式化值的字符串,是一種特定的方式。 它可以用來格式化日期,時間,數字或枚舉。
在這里,我們展示了如何使用格式項的長度分量。 我們將三列數字打印到終端。 左,中和右對齊。
`Program.cs`
```cs
using System;
namespace Format1
{
class Program
{
static void Main(string[] args)
{
int oranges = 2;
int apples = 4;
int bananas = 3;
string str1 = "There are {0} oranges, {1} apples and {2} bananas";
string str2 = "There are {1} oranges, {2} bananas and {0} apples";
Console.WriteLine(str1, oranges, apples, bananas);
Console.WriteLine(str2, apples, oranges, bananas);
}
}
}
```
我們向控制臺打印一條簡單的消息。 我們僅使用格式項的索引部分。
```cs
string str1 = "There are {0} oranges, {1} apples and {2} bananas";
```
`{0}`,`{1}`和`{2}`是格式項。 我們指定索引組件。 其他組件是可選的。
```cs
Console.WriteLine(str1, oranges, apples, bananas);
```
現在,我們將復合格式放在一起。 我們有字符串和對象列表(橙色,蘋果,香蕉)。 `{0}`格式項目是指橙色。 `WriteLine()`方法將`{0}`格式項替換為`oranges`變量的內容。
```cs
string str2 = "There are {1} oranges, {2} bananas and {0} apples";
```
引用對象的格式項的順序很重要。
```cs
$ dotnet run
There are 2 oranges, 4 apples and 3 bananas
There are 2 oranges, 3 bananas and 4 apples
```
我們可以看到該程序的結果。
下一個示例將格式化數字數據。
`Program.cs`
```cs
using System;
namespace Format2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("{0} {1, 12}", "Decimal", "Hexadecimal");
Console.WriteLine("{0:D} {1,8:X}", 502, 546);
Console.WriteLine("{0:D} {1,8:X}", 345, 765);
Console.WriteLine("{0:D} {1,8:X}", 320, 654);
Console.WriteLine("{0:D} {1,8:X}", 120, 834);
Console.WriteLine("{0:D} {1,8:X}", 620, 454);
}
}
}
```
我們以十進制和十六進制格式打印數字。 我們還使用長度分量對齊數字。
```cs
Console.WriteLine("{0:D} {1,8:X}", 502, 546);;
```
`{0:D}`格式項指定,將采用提供的對象列表中的第一項并將其格式化為十進制格式。 `{1,8:X}`格式項目取第二項。 將其格式化為十六進制格式`:X`。 字符串長度為 8 個字符`8` 。 因為數字只有三個字符,所以它會右對齊并用空字符串填充。
```cs
$ dotnet run
Decimal Hexadecimal
502 222
345 2FD
320 28E
120 342
620 1C6
```
運行示例,我們得到了這個結果。
最后兩個示例將格式化數字和日期數據。
`Program.cs`
```cs
using System;
namespace Format3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(string.Format("Number: {0:N}", 126));
Console.WriteLine(string.Format("Scientific: {0:E}", 126));
Console.WriteLine(string.Format("Currency: {0:C}", 126));
Console.WriteLine(string.Format("Percent: {0:P}", 126));
Console.WriteLine(string.Format("Hexadecimal: {0:X}", 126));
}
}
}
```
該示例演示了數字的標準格式說明符。 數字 126 以五種不同格式打印:普通,科學,貨幣,百分比和十六進制。
```cs
$ dotnet run
Number: 126.00
Scientific: 1.260000E+002
Currency: $126.00
Percent: 12,600.00%
Hexadecimal: 7E
```
This is the output of the program.
最后,我們將格式化日期和時間數據。
`Program.cs`
```cs
using System;
namespace Format4
{
class Program
{
static void Main(string[] args)
{
DateTime today = DateTime.Now;
Console.WriteLine(string.Format("Short date: {0:d}", today));
Console.WriteLine(string.Format("Long date: {0:D}", today));
Console.WriteLine(string.Format("Short time: {0:t}", today));
Console.WriteLine(string.Format("Long time: {0:T}", today));
Console.WriteLine(string.Format("Month: {0:M}", today));
Console.WriteLine(string.Format("Year: {0:Y}", today));
}
}
}
```
該代碼示例顯示了當前日期和時間的六種不同格式。
```cs
$ dotnet run
Short date: 10/24/2019
Long date: Thursday, October 24, 2019
Short time: 1:37 PM
Long time: 1:37:38 PM
Month: October 24
Year: October 2019
```
這是示例的輸出。
C# 教程的這一部分介紹了字符串。
- ZetCode 數據庫教程
- MySQL 教程
- MySQL 簡介
- MySQL 安裝
- MySQL 的第一步
- MySQL 快速教程
- MySQL 存儲引擎
- MySQL 數據類型
- 在 MySQL 中創建,更改和刪除表
- MySQL 表達式
- 在 MySQL 中插入,更新和刪除數據
- MySQL 中的SELECT語句
- MySQL 子查詢
- MySQL 約束
- 在 MySQL 中導出和導入數據
- 在 MySQL 中連接表
- MySQL 函數
- MySQL 中的視圖
- MySQL 中的事務
- MySQL 存儲過程
- MySQL Python 教程
- MySQL Perl 教程
- MySQL & Perl DBI
- 使用 Perl 連接到 MySQL 數據庫
- MySQL 中的 Perl 錯誤處理
- 使用 Perl 進行 MySQL 查詢
- 在 MySQL 中使用 Perl 綁定參數&列
- 在 MySQL 中使用 Perl 處理圖像
- 使用 Perl 獲取 MySQL 元數據
- Perl 的 MySQL 事務
- MySQL C API 編程教程
- MySQL Visual Basic 教程
- MySQL PHP 教程
- MySQL Java 教程
- MySQL Ruby 教程
- MySQL C# 教程
- SQLite 教程
- SQLite 簡介
- sqlite3 命令行工具
- 在 SQLite 中創建,刪除和更改表
- SQLite 表達式
- SQLite 插入,更新,刪除數據
- SQLite SELECT語句
- SQLite 約束
- SQLite 連接表
- SQLite 函數
- SQLite 視圖,觸發器,事務
- SQLite C 教程
- SQLite Python 教程
- SQLite Perl 教程
- Perl DBI
- 使用 Perl 連接到 SQLite 數據庫
- SQLite Perl 錯誤處理
- 使用 Perl 的 SQLite 查詢
- 使用 Perl 綁定 SQLite 參數&列
- 使用 Perl 在 SQLite 中處理圖像
- 使用 Perl 獲取 SQLite 元數據
- 使用 Perl 進行 SQLite 事務
- SQLite Ruby 教程
- 連接到 SQLite 數據庫
- 在 SQLite 中使用 Ruby 進行 SQL 查詢
- 綁定參數
- 處理圖像
- 使用 Ruby 獲取 SQLite 元數據
- Ruby 的 SQLite 事務
- SQLite C# 教程
- SQLite C# 簡介
- 使用SqliteDataReader檢索數據
- ADO.NET 數據集
- 使用 C# 在 SQLite 中處理圖像
- 使用 C# 獲取 SQLite 元數據
- 使用 C# 的 SQLite 事務
- SQLite Visual Basic 教程
- SQLite Visual Basic 簡介
- 使用SqliteDataReader檢索數據
- ADO.NET 的數據集
- 使用 Visual Basic 在 SQLite 中處理圖像
- 使用 Visual Basic 獲取 SQLite 元數據
- 使用 Visual Basic 的 SQLite 事務
- PostgreSQL C 教程
- PostgreSQL Ruby 教程
- PostgreSQL PHP 教程
- PostgreSQL PHP 編程簡介
- 在 PostgreSQL 中使用 PHP 檢索數據
- 在 PostgreSQL 中使用 PHP 處理圖像
- 用 PHP 獲取 PostgreSQL 元數據
- 在 PostgreSQL 中使用 PHP 進行事務
- PostgreSQL Java 教程
- Apache Derby 教程
- Derby 簡介
- Derby 的安裝&配置
- Derby 工具
- ij 工具
- Derby 中的 SQL 查詢
- 在 Derby 中使用 JDBC 進行編程
- Derby 安全
- 使用 Derby & Apache Tomcat
- NetBeans 和 Derby
- SQLAlchemy 教程
- SQLAlchemy 簡介
- 原始 SQL
- 模式定義語言
- SQL 表達式語言
- SQLAlchemy 中的對象關系映射器
- MongoDB PHP 教程
- MongoDB JavaScript 教程
- MongoDB Ruby 教程
- Spring JdbcTemplate 教程
- JDBI 教程
- MyBatis 教程
- Hibernate Derby 教程
- ZetCode .NET 教程
- Visual Basic 教程
- Visual Basic
- Visual Basic 語法結構
- 基本概念
- Visual Basic 數據類型
- Visual Basic 中的字符串
- 運算符
- 控制流
- Visual Basic 數組
- Visual Basic 中的過程&函數
- 在 Visual Basic 中組織代碼
- 面向對象編程
- Visual Basic 中的面向對象編程 II
- Visual Basic 中的集合
- 輸入和輸出
- C# 教程
- C# 語言
- C# 語法結構
- C# 基礎
- C# 數據類型
- C# 中的字符串
- C# 運算符
- C# 中的流控制
- C# 數組
- C# 面向對象編程
- C# 中的方法
- C# 面向對象編程 II
- C# 屬性
- C# 結構
- C# 委托
- 命名空間
- C# 集合
- C# 輸入和輸出
- C# 目錄教程
- C# 字典教程
- 在 C# 中讀取文本文件
- C# 中的日期和時間
- 在 C# 中讀取網頁
- C# HttpClient教程
- ASP.NET Core 教程
- ZetCode 圖形教程
- Java 2D 游戲教程
- Java 游戲基礎
- 動畫
- 移動精靈
- 碰撞檢測
- Java 益智游戲
- Java Snake
- Breakout 游戲
- Java 俄羅斯方塊
- Java 吃豆人
- Java 太空侵略者
- Java 掃雷
- Java 推箱子
- Java 2D 教程
- 介紹
- 基本繪圖
- 形狀和填充
- 透明度
- 合成
- 剪裁
- 變換
- 特效
- 圖像
- 文字和字體
- 命中測試,移動物體
- 俄羅斯方塊
- Cario 圖形教程
- Cario 圖形庫
- Cario 定義
- Cairo 后端
- Cairo 基本圖形
- 形狀和填充
- 漸變
- 透明度
- 合成
- 剪裁和遮罩
- 變換
- Cairo 文字
- Cairo 中的圖像
- 根窗口
- PyCairo 教程
- PyCairo 簡介
- PyCairo 后端
- PyCairo 中的基本繪圖
- PyCairo 形狀和填充
- PyCairo 漸變
- PyCairo 剪裁&遮罩
- PyCairo 的透明度
- PyCairo 中的變換
- PyCairo 中的文字
- PyCairo 中的圖像
- 根窗口
- HTML5 畫布教程
- 介紹
- HTML5 畫布中的直線
- HTML5 畫布形狀
- HTML5 畫布填充
- HTML5 畫布中的透明度
- HTML5 畫布合成
- HTML5 canvas 中的變換
- HTML5 畫布中的文字
- HTML5 畫布中的動畫
- HTML5 畫布中的 Snake
- ZetCode GUI 教程
- Windows API 教程
- Windows API 簡介
- Windows API main函數
- Windows API 中的系統函數
- Windows API 中的字符串
- Windows API 中的日期和時間
- Windows API 中的一個窗口
- UI 的第一步
- Windows API 菜單
- Windows API 對話框
- Windows API 控件 I
- Windows API 控件 II
- Windows API 控件 III
- Windows API 中的高級控件
- Windows API 中的自定義控件
- Windows API 中的 GDI
- PyQt4 教程
- PyQt4 簡介
- PyQt4 中的第一個程序
- PyQt4 中的菜單和工具欄
- PyQt4 中的布局管理
- PyQt4 中的事件和信號
- PyQt4 中的對話框
- PyQt4 小部件
- PyQt4 小部件 II
- PyQt4 中的拖放
- PyQt4 中的繪圖
- PyQt4 中的自定義小部件
- PyQt4 中的俄羅斯方塊游戲
- PyQt5 教程
- PyQt5 簡介
- PyQt5 日期和時間
- PyQt5 中的第一個程序
- PyQt5 中的菜單和工具欄
- PyQt5 中的布局管理
- PyQt5 中的事件和信號
- PyQt5 中的對話框
- PyQt5 小部件
- PyQt5 小部件 II
- PyQt5 拖放
- PyQt5 中的繪圖
- PyQt5 中的自定義小部件
- PyQt5 中的俄羅斯方塊
- Qt4 教程
- Qt4 工具包簡介
- Qt4 工具類
- Qt4 中的字符串
- Qt4 中的日期和時間
- 在 Qt4 中使用文件和目錄
- Qt4 中的第一個程序
- Qt4 中的菜單和工具欄
- Qt4 中的布局管理
- Qt4 中的事件和信號
- Qt4 小部件
- Qt4 小部件 II
- Qt4 中的繪圖
- Qt4 中的自定義小部件
- Qt4 中的打磚塊游戲
- Qt5 教程
- Qt5 工具包簡介
- Qt5 中的字符串
- Qt5 中的日期和時間
- Qt5 中的容器
- 在 Qt5 中處理文件和目錄
- Qt5 中的第一個程序
- Qt5 中的菜單和工具欄
- Qt5 中的布局管理
- Qt5 中的事件和信號
- Qt5 小部件
- Qt5 小部件 II
- Qt5 中的繪圖
- Qt5 中的自定義小部件
- Qt5 中的貪食蛇
- Qt5 中的打磚塊游戲
- PySide 教程
- PySide 工具包簡介
- PySide 中的第一個程序
- PySide 中的菜單和工具欄
- PySide 中的布局管理
- PySide 中的事件和信號
- PySide 中的對話框
- PySide 小部件
- PySide 小部件 II
- 在 PySide 中拖放
- 在 PySide 中繪圖
- PySide 中的自定義小部件
- PySide 中的俄羅斯方塊游戲
- Tkinter 教程
- Tkinter 簡介
- Tkinter 中的布局管理
- Tkinter 標準小部件屬性
- Tkinter 小部件
- Tkinter 中的菜單和工具欄
- Tkinter 中的對話框
- Tkinter 中的繪圖
- Tkinter 中的貪食蛇
- Tcl/Tk 教程
- Tcl/Tk 簡介
- Tcl/Tk 中的布局管理
- Tcl/Tk 小部件
- Tcl/Tk 中的菜單和工具欄
- Tcl/Tk 中的對話框
- Tcl/Tk 繪圖
- 貪食蛇
- Qt 快速教程
- Java Swing 教程
- Java Swing 簡介
- Java Swing 首個程序
- Java Swing 中的菜單和工具欄
- Swing 布局管理
- GroupLayout管理器
- Java Swing 事件
- 基本的 Swing 組件
- 基本的 Swing 組件 II
- Java Swing 對話框
- Java Swing 模型架構
- Swing 中的拖放
- Swing 中的繪圖
- Java Swing 中的可調整大小的組件
- Java Swing 中的益智游戲
- 俄羅斯方塊
- JavaFX 教程
- JavaFX 簡介
- JavaFX 首個程序
- JavaFX 布局窗格
- 基本的 JavaFX 控件
- 基本 JavaFX 控件 II
- JavaFX 事件
- JavaFX 效果
- JavaFX 動畫
- JavaFX 畫布
- JavaFX 圖表
- Java SWT 教程
- Java SWT 簡介
- Java SWT 中的布局管理
- Java SWT 中的菜單和工具欄
- Java SWT 中的小部件
- Table小部件
- Java SWT 中的對話框
- Java SWT 繪圖
- Java SWT 中的貪食蛇
- wxWidgets 教程
- wxWidgets 簡介
- wxWidgets 助手類
- wxWidgets 中的第一個程序
- wxWidgets 中的菜單和工具欄
- wxWidgets 中的布局管理
- wxWidgets 中的事件
- wxWidgets 中的對話框
- wxWidgets 小部件
- wxWidgets 小部件 II
- wxWidgets 中的拖放
- wxWidgets 中的設備上下文
- wxWidgets 中的自定義小部件
- wxWidgets 中的俄羅斯方塊游戲
- wxPython 教程
- wxPython 簡介
- 第一步
- 菜單和工具欄
- wxPython 中的布局管理
- wxPython 中的事件
- wxPython 對話框
- 小部件
- wxPython 中的高級小部件
- wxPython 中的拖放
- wxPython 圖形
- 創建自定義小部件
- wxPython 中的應用框架
- wxPython 中的俄羅斯方塊游戲
- C# Winforms Mono 教程
- Mono Winforms 簡介
- Mono Winforms 中的第一步
- Mono Winforms 中的布局管理
- Mono Winforms 中的菜單和工具欄
- Mono Winforms 中的基本控件
- Mono Winforms 中的高級控件
- 對話框
- Mono Winforms 中的拖放
- Mono Winforms 中的繪圖
- Mono Winforms 中的貪食蛇
- Java Gnome 教程
- Java Gnome 簡介
- Java Gnome 的第一步
- Java Gnome 中的布局管理
- Java Gnome 中的布局管理 II
- Java Gnome 中的菜單
- Java Gnome 中的工具欄
- Java Gnome 中的事件
- Java Gnome 中的小部件
- Java Gnome 中的小部件 II
- Java Gnome 中的高級小部件
- Java Gnome 中的對話框
- Java Gnome 中的 Pango
- 在 Java Gnome 中用 Cairo 繪圖
- Cario 繪圖 II
- Java Gnome 中的貪食蛇
- QtJambi 教程
- QtJambi 簡介
- QtJambi 中的布局管理
- QtJambi 中的小部件
- QtJambi 中的菜單和工具欄
- QtJambi 對話框
- QtJambi 中的繪圖
- QtJambi 中的自定義小部件
- 貪食蛇
- GTK+ 教程
- GTK+ 簡介
- GTK+ 中的第一個程序
- GTK+ 中的菜單和工具欄
- GTK+ 布局管理
- GTK+ 事件和信號
- GTK+ 對話框
- GTK+ 小部件
- GTK+ 小部件 II
- GtkTreeView小部件
- GtkTextView小部件
- 自定義 GTK+ 小部件
- Ruby GTK 教程
- Ruby GTK 簡介
- Ruby GTK 中的布局管理
- Ruby GTK 中的小部件
- Ruby GTK 中的菜單和工具欄
- Ruby GTK 中的對話框
- Ruby GTK Cario 繪圖
- Ruby GTK 中的自定義小部件
- Ruby GTK 中的貪食蛇
- GTK# 教程
- GTK# 簡介
- GTK 的第一步
- GTK# 中的布局管理
- GTK 中的菜單
- GTK# 中的工具欄
- GTK# 中的事件
- GTK# 中的小部件
- GTK 中的小部件 II
- GTK# 中的高級小部件
- GTK# 中的對話框
- Pango
- GTK# 中的 Cario 繪圖
- GTK# 中的 Cario 繪圖 II
- GTK# 中的自定義小部件
- Visual Basic GTK# 教程
- Visual Basic GTK# 簡介
- 布局管理
- 小部件
- 菜單和工具欄
- 對話框
- Cario 繪圖
- 自定義小部件
- 貪食蛇
- PyGTK 教程
- PyGTK 簡介
- PyGTK 的第一步
- PyGTK 中的布局管理
- PyGTK 中的菜單
- PyGTK 中的工具欄
- PyGTK 中的事件和信號
- PyGTK 中的小部件
- PyGTK 中的小部件 II
- PyGTK 中的高級小部件
- PyGTK 中的對話框
- Pango
- Pango II
- PyGTK 中的 Cario 繪圖
- Cario 繪圖 II
- PyGTK 中的貪食蛇游戲
- PyGTK 中的自定義小部件
- PHP GTK 教程
- PHP GTK 簡介
- PHP GTK 中的布局管理
- PHP GTK 中的小部件
- PHP GTK 中的菜單和工具欄
- 對話框
- Cario 繪圖
- 自定義小部件
- 貪食蛇
- C# Qyoto 教程
- Qyoto 介紹
- 布局管理
- Qyoto 中的小部件
- Qyoto 中的菜單和工具欄
- Qyoto 對話框
- Qyoto 中的繪圖
- Qyoto 中的繪圖 II
- Qyoto 中的自定義小部件
- 貪食蛇
- Ruby Qt 教程
- Ruby Qt 簡介
- Ruby Qt 中的布局管理
- Ruby Qt 中的小部件
- 菜單和工具欄
- Ruby Qt 中的對話框
- 用 Ruby Qt 繪圖
- Ruby Qt 中的自定義小部件
- Ruby Qt 中的貪食蛇
- Visual Basic Qyoto 教程
- Qyoto 介紹
- 布局管理
- Qyoto 中的小部件
- Qyoto 中的菜單和工具欄
- Qyoto 對話框
- Qyoto 中的繪圖
- Qyoto 中的自定義小部件
- 貪食蛇
- Mono IronPython Winforms 教程
- 介紹
- IronPython Mono Winforms 中的第一步
- 布局管理
- 菜單和工具欄
- Mono Winforms 中的基本控件
- Mono Winforms 中的基本控件 II
- Mono Winforms 中的高級控件
- 對話框
- Mono Winforms 中的拖放
- 繪圖
- IronPython Mono Winforms 中的繪圖 II
- IronPython Mono Winforms 中的貪食蛇
- IronPython Mono Winforms 中的俄羅斯方塊游戲
- FreeBASIC GTK 教程
- Jython Swing 教程
- Jython Swing 簡介
- Jython Swing 中的布局管理
- Jython Swing 中的組件
- Jython Swing 中的菜單和工具欄
- Jython Swing 中的對話框
- Jython Swing 中的繪圖
- Jython Swing 中的半字節
- JRuby Swing 教程
- JRuby Swing 簡介
- JRuby Swing 中的布局管理
- JRuby Swing 中的組件
- 菜單和工具欄
- JRuby Swing 中的對話框
- 在 JRuby Swing 中繪圖
- JRuby Swing 中的貪食蛇
- Visual Basic Winforms 教程
- Visual Basic Winforms 簡介
- 布局管理
- 基本控制
- 進階控件
- 菜單和工具欄
- 對話框
- 繪圖
- 拖放
- 貪食蛇
- JavaScript GTK 教程
- JavaScript GTK 簡介
- 布局管理
- JavaScript GTK 中的小部件
- JavaScript GTK 中的菜單和工具欄
- JavaScript GTK 中的對話框
- JavaScript GTK 中的 Cario 繪圖
- ZetCode Java 教程
- Java 教程
- Java 語言
- Java 語法結構
- Java 基礎
- Java 數據類型
- Java 數據類型 II
- Java 字符串
- Java 數組
- Java 表達式
- Java 控制流程
- Java 面向對象的編程
- Java 方法
- Java 面向對象編程 II
- Java 包
- Java 中的異常
- Java 集合
- Java 流
- Java Future 教程
- Java Comparable和Comparator
- Java DOM 教程
- Java MVC 教程
- Java SAX 教程
- Java JAXB 教程
- Java JSON 處理教程
- Java H2 教程
- MongoDB Java 教程
- Java 正則表達式教程
- Java PDFBox 教程
- Java 文件教程
- Java Files.list教程
- Java Files.walk教程
- Java DirectoryStream教程
- Java 外部與內部迭代器
- Java 文件大小
- 用 Java 創建目錄
- 用 Java 創建文件
- Java Log4j 教程
- Gson 教程
- Java RequestDispatcher
- Java HTTP GET/POST 請求
- Java InputStream教程
- Java FileOutputStream教程
- Java FileInputStream教程
- Java ZipInputStream教程
- Java FileWriter教程
- EJB 簡介
- Java forEach教程
- Jetty 教程
- Tomcat Derby 教程
- Stripes 介紹
- 使用 Stripes 的 Java webapp,MyBatis,& Derby
- EclipseLink 簡介
- Java 中的數據源
- JSTL 中的 SQL 查詢標記
- Java 驗證過濾器
- Hibernate 驗證器
- 用 Java 顯示圖像
- Play 框架簡介
- Spark Java 簡介
- Java ResourceBundle教程
- Jtwig 教程
- Java Servlet 教程
- Java 套接字教程
- FreeMarker 教程
- Android 教程
- Java EE 5 教程
- JSoup 教程
- JFreeChart 教程
- ImageIcon教程
- 用 Java 復制文件
- Java 文件時間教程
- 如何使用 Java 獲取當前日期時間
- Java 列出目錄內容
- Java 附加到文件
- Java ArrayList教程
- 用 Java 讀寫 ICO 圖像
- Java int到String的轉換
- Java HashSet教程
- Java HashMap教程
- Java static關鍵字
- Java 中的HashMap迭代
- 用 Java 過濾列表
- 在 Java 中讀取網頁
- Java 控制臺應用
- Java 集合的便利工廠方法
- Google Guava 簡介
- OpenCSV 教程
- 用 Java8 的StringJoiner連接字符串
- Java 中元素迭代的歷史
- Java 謂詞
- Java StringBuilder
- Java 分割字串教學
- Java NumberFormat
- Java TemporalAdjusters教程
- Apache FileUtils教程
- Java Stream 過濾器
- Java 流歸約
- Java 流映射
- Java InputStreamReader教程
- 在 Java 中讀取文本文件
- Java Unix 時間
- Java LocalTime
- Java 斐波那契
- Java ProcessBuilder教程
- Java 11 的新功能
- ZetCode JavaScript 教程
- Ramda 教程
- Lodash 教程
- Collect.js 教程
- Node.js 簡介
- Node HTTP 教程
- Node-config 教程
- Dotenv 教程
- Joi 教程
- Liquid.js 教程
- faker.js 教程
- Handsontable 教程
- PouchDB 教程
- Cheerio 教程
- Axios 教程
- Jest 教程
- JavaScript 正則表達式
- 用 JavaScript 創建對象
- Big.js 教程
- Moment.js 教程
- Day.js 教程
- JavaScript Mustache 教程
- Knex.js 教程
- MongoDB JavaScript 教程
- Sequelize 教程
- Bookshelf.js 教程
- Node Postgres 教程
- Node Sass 教程
- Document.querySelector教程
- Document.all教程
- JSON 服務器教程
- JavaScript 貪食蛇教程
- JavaScript 構建器模式教程
- JavaScript 數組
- XMLHttpRequest教程
- 從 JavaScript 中的 URL 讀取 JSON
- 在 JavaScript 中循環遍歷 JSON 數組
- jQuery 教程
- Google 圖表教程
- ZetCode Kotlin 教程
- Kotlin Hello World 教程
- Kotlin 變量
- Kotlin 的運算符
- Kotlin when表達式
- Kotlin 數組
- Kotlin 范圍
- Kotlin Snake
- Kotlin Swing 教程
- Kotlin 字符串
- Kotlin 列表
- Kotlin 映射
- Kotlin 集合
- Kotlin 控制流程
- Kotlin 寫入文件
- Kotlin 讀取文件教程
- Kotlin 正則表達式
- ZetCode 其它教程
- TCL 教程
- Tcl
- Tcl 語法結構
- Tcl 中的基本命令
- Tcl 中的表達式
- Tcl 中的控制流
- Tcl 中的字符串
- Tcl 列表
- Tcl 中的數組
- Tcl 中的過程
- 輸入&輸出
- AWK 教程
- Vaadin 教程
- Vaadin 框架介紹
- Vaadin Grid教程
- Vaadin TextArea教程
- Vaadin ComboBox教程
- Vaadin Slider教程
- Vaadin CheckBox教程
- Vaadin Button教程
- Vaadin DateField教程
- Vaadin Link教程
- ZetCode PHP 教程
- PHP 教程
- PHP
- PHP 語法結構
- PHP 基礎
- PHP 數據類型
- PHP 字符串
- PHP 運算符
- PHP 中的控制流
- PHP 數組
- PHP 數組函數
- PHP 中的函數
- PHP 正則表達式
- PHP 中的面向對象編程
- PHP 中的面向對象編程 II
- PHP Carbon 教程
- PHP Monolog 教程
- PHP 配置教程
- PHP Faker 教程
- Twig 教程
- Valitron 教程
- Doctrine DBAL QueryBuilder 教程
- PHP Respect 驗證教程
- PHP Rakit 驗證教程
- PHP PDO 教程
- CakePHP 數據庫教程
- PHP SQLite3 教程
- PHP 文件系統函數
- ZetCode Python 教程
- Python 教程
- Python 語言
- 交互式 Python
- Python 語法結構
- Python 數據類型
- Python 字符串
- Python 列表
- Python 字典
- Python 運算符
- Python 關鍵字
- Python 函數
- Python 中的文件
- Python 中的面向對象編程
- Python 模塊
- Python 中的包
- Python 異常
- Python 迭代器和生成器
- Python 內省
- Python Faker 教程
- Python f 字符串教程
- Python bcrypt 教程
- Python 套接字教程
- Python smtplib教程
- OpenPyXL 教程
- Python pathlib教程
- Python YAML 教程
- Python 哈希教程
- Python ConfigParser教程
- Python 日志教程
- Python argparse 教程
- Python SQLite 教程
- Python Cerberus 教程
- Python PostgreSQL 教程
- PyMongo 教程
- PyMySQL 教程
- Peewee 教程
- pyDAL 教程
- pytest 教程
- Bottle 教程
- Python Jinja 教程
- PrettyTable 教程
- BeautifulSoup 教程
- pyquery 教程
- Python for循環
- Python 反轉
- Python Lambda 函數
- Python 集合
- Python 映射
- Python CSV 教程-讀寫 CSV
- Python 正則表達式
- Python SimpleJson 教程
- SymPy 教程
- Pandas 教程
- Matplotlib 教程
- Pillow 教程
- Python FTP 教程
- Python Requests 教程
- Python Arrow 教程
- Python 列表推導式
- Python 魔術方法
- PyQt 中的QPropertyAnimation
- PyQt 中的QNetworkAccessManager
- ZetCode Ruby 教程
- Ruby 教程
- Ruby
- Ruby 語法結構
- Ruby 基礎
- Ruby 變量
- Ruby 中的對象
- Ruby 數據類型
- Ruby 字符串
- Ruby 表達式
- Ruby 控制流
- Ruby 數組
- Ruby 哈希
- Ruby 中的面向對象編程
- Ruby 中的面向對象編程 II
- Ruby 正則表達式
- Ruby 輸入&輸出
- Ruby HTTPClient教程
- Ruby Faraday 教程
- Ruby Net::HTTP教程
- ZetCode Servlet 教程
- 從 Java Servlet 提供純文本
- Java Servlet JSON 教程
- Java Servlet HTTP 標頭
- Java Servlet 復選框教程
- Java servlet 發送圖像教程
- Java Servlet JQuery 列表教程
- Servlet FreeMarker JdbcTemplate 教程-CRUD 操作
- jQuery 自動補全教程
- Java servlet PDF 教程
- servlet 從 WAR 內讀取 CSV 文件
- Java HttpServletMapping
- EasyUI datagrid
- Java Servlet RESTFul 客戶端
- Java Servlet Log4j 教程
- Java Servlet 圖表教程
- Java ServletConfig教程
- Java Servlet 讀取網頁
- 嵌入式 Tomcat
- Java Servlet 分頁
- Java Servlet Weld 教程
- Java Servlet 上傳文件
- Java Servlet 提供 XML
- Java Servlet 教程
- JSTL forEach標簽
- 使用 jsGrid 組件
- ZetCode Spring 教程
- Spring @Bean注解教程
- Spring @Autowired教程
- Spring @GetMapping教程
- Spring @PostMapping教程
- Spring @DeleteMapping教程
- Spring @RequestMapping教程
- Spring @PathVariable教程
- Spring @RequestBody教程
- Spring @RequestHeader教程
- Spring Cookies 教程
- Spring 資源教程
- Spring 重定向教程
- Spring 轉發教程
- Spring ModelAndView教程
- Spring MessageSource教程
- Spring AnnotationConfigApplicationContext
- Spring BeanFactoryPostProcessor教程
- Spring BeanFactory教程
- Spring context:property-placeholder教程
- Spring @PropertySource注解教程
- Spring @ComponentScan教程
- Spring @Configuration教程
- Spring C 命名空間教程
- Spring P 命名空間教程
- Spring bean 引用教程
- Spring @Qualifier注解教程
- Spring ClassPathResource教程
- Spring 原型作用域 bean
- Spring Inject List XML 教程
- Spring 概要文件 XML 教程
- Spring BeanDefinitionBuilder教程
- Spring 單例作用域 bean
- 獨立的 Spring 應用
- 經典 Spring 應用中的JdbcTemplate
- Spring EmbeddedDatabaseBuilder教程
- Spring HikariCP 教程
- Spring Web 應用簡介
- Spring BeanPropertyRowMapper教程
- Spring DefaultServlet教程
- Spring WebSocket 教程
- Spring WebJars 教程
- Spring @MatrixVariable教程
- Spring Jetty 教程
- Spring 自定義 404 錯誤頁面教程
- Spring WebApplicationInitializer教程
- Spring BindingResult教程
- Spring FreeMarker 教程
- Spring Thymeleaf 教程
- Spring ResourceHandlerRegistry教程
- SpringRunner 教程
- Spring MockMvc 教程
- ZetCode Spring Boot 教程
- Spring Boot 發送電子郵件教程
- Spring Boot WebFlux 教程
- Spring Boot ViewControllerRegistry教程
- Spring Boot CommandLineRunner教程
- Spring Boot ApplicationReadyEvent 教程
- Spring Boot CORS 教程
- Spring Boot @Order教程
- Spring Boot @Lazy教程
- Spring Boot Flash 屬性
- Spring Boot CrudRepository 教程
- Spring Boot JpaRepository 教程
- Spring Boot findById 教程
- Spring Boot Data JPA @NamedQuery教程
- Spring Boot Data JPA @Query教程
- Spring Boot Querydsl 教程
- Spring Boot Data JPA 排序教程
- Spring Boot @DataJpaTest教程
- Spring Boot TestEntityManager 教程
- Spring Boot Data JPA 派生的查詢
- Spring Boot Data JPA 查詢示例
- Spring Boot Jersey 教程
- Spring Boot CSV 教程
- SpringBootServletInitializer教程
- 在 Spring Boot 中加載資源
- Spring Boot H2 REST 教程
- Spring Boot RestTemplate
- Spring Boot REST XML 教程
- Spring Boot Moustache 教程
- Spring Boot Thymeleaf 配置
- Spring Boot 自動控制器
- Spring Boot FreeMarker 教程
- Spring Boot Environment
- Spring Boot Swing 集成教程
- 在 Spring Boot 中提供圖像文件
- 在 Spring Boot 中創建 PDF 報告
- Spring Boot 基本注解
- Spring Boot @ResponseBody教程
- Spring Boot @PathVariable教程
- Spring Boot REST Data JPA 教程
- Spring Boot @RequestParam教程
- Spring Boot 列出 bean
- Spring Boot @Bean
- Spring Boot @Qualifier教程
- 在 Spring Boot 中提供靜態內容
- Spring Boot Whitelabel 錯誤
- Spring Boot DataSourceBuilder 教程
- Spring Boot H2 教程
- Spring Boot Web JasperReports 集成
- Spring Boot iText 教程
- Spring Boot cmd JasperReports 集成
- Spring Boot RESTFul 應用
- Spring Boot 第一個 Web 應用
- Spring Boot Groovy CLI
- Spring Boot 上傳文件
- Spring Boot @ExceptionHandler
- Spring Boot @ResponseStatus
- Spring Boot ResponseEntity
- Spring Boot @Controller
- Spring Boot @RestController
- Spring Boot @PostConstruct
- Spring Boot @Component
- Spring Boot @ConfigurationProperties教程
- Spring Boot @Repository
- Spring Boot MongoDB 教程
- Spring Boot MongoDB Reactor 教程
- Spring Boot PostgreSQL 教程
- Spring Boot @ModelAttribute
- Spring Boot 提交表單教程
- Spring Boot Model
- Spring Boot MySQL 教程
- Spring Boot GenericApplicationContext
- SpringApplicationBuilder教程
- Spring Boot Undertow 教程
- Spring Boot 登錄頁面教程
- Spring Boot RouterFunction 教程
- ZetCode Symfony 教程
- Symfony DBAL 教程
- Symfony 表單教程
- Symfony CSRF 教程
- Symfony Vue 教程
- Symfony 簡介
- Symfony 請求教程
- Symfony HttpClient教程
- Symfony Flash 消息
- 在 Symfony 中發送郵件
- Symfony 保留表單值
- Symfony @Route注解教程
- Symfony 創建路由
- Symfony 控制臺命令教程
- Symfony 上傳文件
- Symfony 服務教程
- Symfony 驗證教程
- Symfony 翻譯教程