Skip to content

tuple_strrstrTupleStrrstrTupleStrrstrtuple_strrstrtuple_strrstr🔗

説明🔗

tuple_strrstrTupleStrrstrTupleStrrstrtuple_strrstrtuple_strrstr — 文字列 tuple の文字列を後方から検索する。

書式🔗

tuple_strrstr( string String, string ToFind, out integer Position )void TupleStrrstr( const HTuple& String, const HTuple& ToFind, HTuple* Position )static void HOperatorSet.TupleStrrstr( HTuple stringVal, HTuple toFind, out HTuple position )def tuple_strrstr( string: MaybeSequence[str], to_find: MaybeSequence[str] ) -> Sequence[int]

def tuple_strrstr_s( string: MaybeSequence[str], to_find: MaybeSequence[str] ) -> intHerror tuple_strrstr( const char* String, const char* ToFind, Hlong* Position )

Herror T_tuple_strrstr( const Htuple String, const Htuple ToFind, Htuple* Position )

HTuple HTuple::TupleStrrstr( const HTuple& ToFind ) const

HTuple HTuple.TupleStrrstr( HTuple toFind )

説明🔗

tuple_strrstrTupleStrrstr は入力 StringstringValstring の文字列内で入力 tuple ToFindtoFindto_find の文字列を検索します。両方の入力 tuple は文字列のみで す。そうでなければ tuple_strrstrTupleStrrstr はエラーを返します。この オペレーターは後方からの検索に使われます。全ての文字を最後から最初 に向かって検査します。StringstringValstring が 1 つの文字列のみを含むなら ToFindtoFindto_find の全ての文字列はその中で検索されます。 従って出力 tuple は ToFindtoFindto_find と同数の要素で表されます。 検索された文字列が見つかったときその初めて見つかった位置が出力 tuple Positionpositionposition に貯えられます。(文字列の位置は 0 から開始 します。) 文字列が見つけられなかったら位置の代わりに -1 が返ります。両方の入 力 tuple が同じ要素数を持つなら対応した要素間で検索が行われます。 ToFindtoFindto_find の最初の文字列は StringstringValstring の最初の文字列内で検索さ れ、ToFindtoFindto_find の 2 番目の文字列は StringstringValstring の 2 番目の文字列 内で検索されます。要素間の検索結果は StringstringValstring と ToFindtoFindto_find と 同じ要素数を含む Positionpositionposition に返されます。ToFindtoFindto_find が 1 つの文字列のみを含むならこれは StringstringValstring の全ての文字列内で検索 されます。従ってこの場合 Positionpositionposition は StringstringValstring と同数の 要素で表現されます。両方の tuple が 2つ以上の要素から成り、入力 tuple の要素数が違う場合、tuple_strrstrTupleStrrstr はエラーを返しま す。

どちらかの、または両方の入力tupleが空の場合、この関数は空のtupleを返します。

Unicodeコードポイントとバイト🔗

ポジションは、Unicodeコードポイントを参照します。 1つのUnicodeコードポイントは、UTF-8文字列の複数のバイトで構成されています。 ポジションが文字列の生のバイトを参照する必要がある場合、このオペレータは set_system('tsp_tuple_string_operator_mode', 'byte')SetSystem("tsp_tuple_string_operator_mode", "byte")SetSystem("tsp_tuple_string_operator_mode", "byte")set_system("tsp_tuple_string_operator_mode", "byte")set_system("tsp_tuple_string_operator_mode", "byte")を使用して バイトモードに切り替えることができます。 'filename_encoding'"filename_encoding" が ‘'locale'"locale" (legacy)に設定されている場合、 このオペレータは常にバイトモードを使用します。

文字列操作の概要は Tuple / String Operations をご覧ください。

HDevelopインライン演算🔗

HDevelopは tuple_strrstrTupleStrrstr の代わりとなるインライン演算を備えており、以下の構文形式で使 用することができます::

Position := strrstr(String, ToFind)

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

StringstringValstring (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

入力 tuple 1

ToFindtoFindto_find (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

入力 tuple 2

Positionpositionposition (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

検査文字列内の検索された文字の位置

他のオペレーターとの組み合わせ🔗

組み合わせ

他の選択候補

tuple_strstrTupleStrstr, tuple_strlenTupleStrlen, tuple_strchrTupleStrchr, tuple_strrchrTupleStrrchr, tuple_substrTupleSubstr, tuple_str_first_nTupleStrFirstN, tuple_str_last_nTupleStrLastN, tuple_splitTupleSplit, tuple_environmentTupleEnvironment

モジュール🔗

Foundation