文字列の長さを取得する
文字列の長さは、System.String クラスの Length プロパティから取得します。
サンプルコード
以下にサンプルコードを示します。
J# (Java)
// 必要な変数を宣言する
String stTarget = "StringLength";
// 文字列の長さを取得する
int iLength = stTarget.get_Length();
// 取得した文字列の長さを表示する
MessageBox.Show(System.Convert.ToString(iLength));
関連するリファレンス
以下に関連するリファレンスを示します。
