Skip to content

tuple_str_replaceTupleStrReplaceTupleStrReplacetuple_str_replacetuple_str_replace🔗

説明🔗

tuple_str_replaceTupleStrReplaceTupleStrReplacetuple_str_replacetuple_str_replace — 文字列内の部分文字列をすべて置換する。

書式🔗

tuple_str_replace( string String, string Before, string After, out string Replaced )void TupleStrReplace( const HTuple& String, const HTuple& Before, const HTuple& After, HTuple* Replaced )static void HOperatorSet.TupleStrReplace( HTuple stringVal, HTuple before, HTuple after, out HTuple replaced )def tuple_str_replace( string: MaybeSequence[str], before: MaybeSequence[str], after: MaybeSequence[str] ) -> Sequence[str]

def tuple_str_replace_s( string: MaybeSequence[str], before: MaybeSequence[str], after: MaybeSequence[str] ) -> strHerror tuple_str_replace( const char* String, const char* Before, const char* After, char* Replaced )

Herror T_tuple_str_replace( const Htuple String, const Htuple Before, const Htuple After, Htuple* Replaced )

HTuple HTuple::TupleStrReplace( const HTuple& Before, const HTuple& After ) const

HTuple HTuple.TupleStrReplace( HTuple before, HTuple after )

説明🔗

tuple_str_replaceTupleStrReplace は入力 StringstringValstring の中に出現する全ての 部分文字列 Beforebeforebefore を Afterafterafter に置き換え、結果をReplacedreplacedreplaced に返します。 3つの入力 tupleは全て文字列のみで構成されている必要があります。それ以外の場合、 tuple_str_replaceTupleStrReplaceはエラーを返します。 例外として、Afterafterafterが空の tupleである場合は、空の文字列に対応します。 BeforebeforebeforeとAfterafterafterは同じ要素数である必要があります。 両方の tuple が1つの要素から成る場合、tupleStringstringValstringのすべての入力文字列に 対してBeforebeforebeforeがAfterafterafterに置き換えられます。 両方のtupleがtuple StringstringValstringと同じ数の要素から成る場合、StringstringValstringの n番目の要素に対してBeforebeforebeforeのn番目の文字列がAfterafterafterのn番目の 文字列に置き換えられます。 すべての置換が行われた文字列はReplacedreplacedreplacedで返され、どちらの場合も StringstringValstringと同じ数の要素を含みます。

文字列操作の一般的な情報については、Tuple / String Operationsを参照してください。

HDevelopインライン演算🔗

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

Replaced := str_replace(String, Before, After)

実行情報🔗

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

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

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

パラメーター🔗

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

入力 tuple

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

探索する部分文字列のtuple

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

Beforebeforebefore を置き換える部分文字列のtuple

Replacedreplacedreplaced (output_control) string(-array) → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

置換後の出力 tuple

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

組み合わせ

他の選択候補

tuple_regexp_replaceTupleRegexpReplace

モジュール🔗

Foundation