差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
dotnet:string [2009/01/14 16:09] – nakayama | dotnet:string [2019/05/18 02:23] (現在) – 外部編集 非ログインユーザー | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== String.Formatメソッドで中かっこ({})をエスケープする | + | ====== String クラス (System) ====== |
- | 文字列の書式編集を行う場合で、中かっこ({})を出力するには、中かっこを2つ並べてエスケープする必要がある。 | + | ===== String.Formatメソッドで中かっこ({})をエスケープする ===== |
+ | 文字列の書式編集を行う場合で、中かっこ({})を出力するには、中かっこを2つ並べてエスケープする必要がある。\\ | ||
+ | \\ | ||
+ | [VB] | ||
+ | <code vbnet> | ||
+ | Dim count As Integer = 10 | ||
+ | Dim message As String = String.Format(" | ||
+ | Console.WriteLine(message) | ||
+ | </ | ||
+ | [C#] | ||
<code csharp> | <code csharp> | ||
int count = 10; | int count = 10; | ||
string message = string.Format(" | string message = string.Format(" | ||
Console.WriteLine(message); | Console.WriteLine(message); | ||
+ | </ | ||
+ | [C++] | ||
+ | <code cpp> | ||
+ | int count = 10; | ||
+ | String^ message = String:: | ||
+ | Console:: | ||
</ | </ | ||
コンソールに " | コンソールに " | ||
+ |