System.WideStrings.TWideStrings.IndexOf

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

function IndexOf(const S: WideString): Integer; virtual;

C++

virtual int __fastcall IndexOf(const System::WideString S);

プロパティ

種類 可視性 ソース ユニット
function public
System.WideStrings.pas
System.WideStrings.hpp
System.WideStrings TWideStrings

説明

リスト内の文字列の位置を返します。

文字列 S、または大文字小文字のみが S と異なる文字列が最初に出現する位置を取得するには、IndexOf を呼び出します。IndexOf は、文字列の 0 を起点とするインデックスを返します。したがって、S がリスト内の最初の文字列に一致する場合、IndexOf は 0 を返し、S が 2 番目の文字列に一致する場合、IndexOf は 1 を返します。その他の場合も同様に動作します。文字列がリストにない場合は、IndexOf は -1 を返します。

メモ:文字列がリストに複数存在する場合、IndexOf は最初に出現する位置を返します。

関連項目