Page 42 - ePB316_最佳案例 Visual Basic 2017 程式設計
P. 42
Visual Basic 2017 程式設計
ɓeWrite ˙ج
Write ˙جϞ 17 ၇ε༱dʱε༱νɨྡהͪf
ਗ਼ܸ֛̺؍࠽Booleanٙ˖οڌͪᄳɝᅺ፩̈
Write(Boolean)
༟ࣘݴf
Write(Char) ਗ਼ܸ֛ٙ Unicode οʩ࠽ᄳɝᅺ፩̈༟ࣘݴf
Write(array<Char>^) ਗ਼ܸ֛ٙ Unicode οʩ৬ΐᄳɝᅺ፩̈༟ࣘݴf
Write(array<Char>^, Int32, Int32) ਗ਼ܸ֛ٙ Unicode οʩɿ৬ΐᄳɝᅺ፩̈༟ࣘݴf
Write(Decimal) ਗ਼ܸ֛ Decimal ࠽ٙڌͪ˖οᄳɝᅺ፩̈༟ࣘݴf
ਗ਼ܸ֛ٙᕐၚᆽܓओᓃᅰ࠽ٙ˖οڌͪᄳɝᅺ፩̈
Write(Double)
༟ࣘݴf
͉ఊʩසʧୗՇ၇˾ڌٙ˙جdʱй݊ Write(Short) ၾ Write(String, Object)f
1. Overloads Public Shared Sub Write(Short)
ʮ͜˙جd̙ਗ਼ Short ۨйٙ༟ࣘ፩̈fԷνj
Dim a As Short = 5
Console.Write(a)
ഐ؈݊ 5f
2. Overloads Public Shared Sub Write(String, Object)
Ϥ˙ج̙ਗ਼ܸ֛༟ࣘ˸ࣸόʷοЕ፩̈fԷνj
Dim a As Short = 50000
Dim b As Short = 20000
Console.Write("{0:c} {1:n}", a, b)
ٙ፩̈νɨf
NT$50,000.00 20,000.00
Չʕ {0:c} ၾ {1:n} ٙ 0 ၾ 1 ڌͪהࠅ ୌ ᗳйΤ၈
࿁Ꮠٙ༟ࣘනҏɪԷ a ٙනҏ݊ 0d C ࿆ୌ
D ɤආЗ
b ݊ 1ic ၾ n ˾ڌ፩̈ࣸόd੬͜
E ߅ኪা
ٙ፩̈ࣸόν̛ڌהͪd˲ɽʃᄳே F ʃᅰٙЗᅰfԷνjF5 ڌͪʃᅰ՟ 5 Зf
ൖމΝf N ᜑͪɷʱЗ
X ɤʬආЗ
34