ClassesClassesClassesClasses | | | | Operators

tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit (Operator)

Name

tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit — Split strings into substrings using predefined separator symbol(s).

Signature

tuple_split( : : String, Separator : Substrings)

Herror tuple_split(const char* String, const char* Separator, char* Substrings)

Herror T_tuple_split(const Htuple String, const Htuple Separator, Htuple* Substrings)

Herror tuple_split(const HTuple& String, const HTuple& Separator, char* Substrings)

Herror tuple_split(const HTuple& String, const HTuple& Separator, HTuple* Substrings)

void TupleSplit(const HTuple& String, const HTuple& Separator, HTuple* Substrings)

HTuple HTuple::TupleSplit(const HTuple& Separator) const

void HOperatorSetX.TupleSplit(
[in] VARIANT String, [in] VARIANT Separator, [out] VARIANT* Substrings)

VARIANT HTupleX.TupleSplit(
[in] VARIANT String, [in] VARIANT Separator)

static void HOperatorSet.TupleSplit(HTuple stringVal, HTuple separator, out HTuple substrings)

HTuple HTuple.TupleSplit(HTuple separator)

Description

tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit searches within the strings of the input tuple StringStringStringStringStringstringVal for one or more separators defined in the input tuple SeparatorSeparatorSeparatorSeparatorSeparatorseparator. tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit then splits the examined strings into the substrings divided by the separators. Both input tuples may only consist of strings. Otherwise tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit returns an error. If the elements of SeparatorSeparatorSeparatorSeparatorSeparatorseparator contain more than one character, each character defines a separator. If StringStringStringStringStringstringVal consists only of one string, this is split up several times according to the elements of SeparatorSeparatorSeparatorSeparatorSeparatorseparator. For example: If StringStringStringStringStringstringVal consists of the string “data1;data2:7;data3” and SeparatorSeparatorSeparatorSeparatorSeparatorseparator contains the strings “;” and “:;”, the output tuple SubstringsSubstringsSubstringsSubstringsSubstringssubstrings will comprise the strings “data1”, “data2:7”, “data3” as the result of splitting the string of StringStringStringStringStringstringVal according to the first element of SeparatorSeparatorSeparatorSeparatorSeparatorseparator and “data1”, “data2”, “7” and “data3” as the result of splitting according to the second element of SeparatorSeparatorSeparatorSeparatorSeparatorseparator. If both input tuples show the same number of elements, the search is done elementwise. I.e., tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit will split the first string of StringStringStringStringStringstringVal according to the separators in the first element of SeparatorSeparatorSeparatorSeparatorSeparatorseparator, the second string of StringStringStringStringStringstringVal according to the separators in the second element of SeparatorSeparatorSeparatorSeparatorSeparatorseparator and so on. If SeparatorSeparatorSeparatorSeparatorSeparatorseparator only contains one string, the separators defined in this string will be used to split up all the strings of StringStringStringStringStringstringVal. If both input tuples contain more than one element and the number of elements differs for the input tuples, tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit returns an error. Subsequent occurences of SeparatorSeparatorSeparatorSeparatorSeparatorseparator in StringStringStringStringStringstringVal are treated as one separator. Separators at the beginning and the end of StringStringStringStringStringstringVal are ignored.

For general information about string operations see Tuple / String Operations.

Exception: Empty input tuples

If either or both of the input tuples are empty, the operator returns an empty tuple.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit, which can be used in an expression in the following syntax:

Substrings := split(String, Separator)

Parallelization

Parameters

StringStringStringStringStringstringVal (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Input tuple with string(s) to split.

SeparatorSeparatorSeparatorSeparatorSeparatorseparator (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Input tuple with separator symbol(s).

SubstringsSubstringsSubstringsSubstringsSubstringssubstrings (output_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Substrings after splitting the input strings.

Alternatives

tuple_strstrtuple_strstrTupleStrstrtuple_strstrTupleStrstrTupleStrstr, tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr, tuple_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr, tuple_strrchrtuple_strrchrTupleStrrchrtuple_strrchrTupleStrrchrTupleStrrchr, tuple_strlentuple_strlenTupleStrlentuple_strlenTupleStrlenTupleStrlen, tuple_str_first_ntuple_str_first_nTupleStrFirstNtuple_str_first_nTupleStrFirstNTupleStrFirstN, tuple_str_last_ntuple_str_last_nTupleStrLastNtuple_str_last_nTupleStrLastNTupleStrLastN, tuple_environmenttuple_environmentTupleEnvironmenttuple_environmentTupleEnvironmentTupleEnvironment

Module

Foundation


ClassesClassesClassesClasses | | | | Operators