ClassesClassesClassesClasses | | | | Operators

tuple_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr (Operator)


tuple_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr — Forward search for characters within a string tuple.


tuple_strchr( : : String, ToFind : Position)

Herror tuple_strchr(const char* String, const char* ToFind, Hlong* Position)

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

Herror tuple_strchr(const HTuple& String, const HTuple& ToFind, Hlong* Position)

Herror tuple_strchr(const HTuple& String, const HTuple& ToFind, HTuple* Position)

void TupleStrchr(const HTuple& String, const HTuple& ToFind, HTuple* Position)

HTuple HTuple::TupleStrchr(const HTuple& ToFind) const

void HOperatorSetX.TupleStrchr(
[in] VARIANT String, [in] VARIANT ToFind, [out] VARIANT* Position)

VARIANT HTupleX.TupleStrchr(
[in] VARIANT String, [in] VARIANT ToFind)

static void HOperatorSet.TupleStrchr(HTuple stringVal, HTuple toFind, out HTuple position)

HTuple HTuple.TupleStrchr(HTuple toFind)


tuple_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr searches within the strings of the input tuple StringStringStringStringStringstringVal for the characters of the input tuple ToFindToFindToFindToFindToFindtoFind. Both input tuples may only consist of strings. Otherwise tuple_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr returns an error. If the elements of ToFindToFindToFindToFindToFindtoFind contain more than one character, only the first character of each element is considered for searching. If StringStringStringStringStringstringVal contains only one string, all the characters defined in ToFindToFindToFindToFindToFindtoFind are searched in this string. Thus, the output tuple consists of as many elements as ToFindToFindToFindToFindToFindtoFind. Whenever a searched character has been found, the position of its first occurrence gets stored in the output tuple PositionPositionPositionPositionPositionposition (remark: the position starts at 0 for the first character of a string). If a character can not be found, -1 will be returned instead of its position. If both input tuples show the same number of elements, the search is done elementwise. I.e., the first character of the first element of ToFindToFindToFindToFindToFindtoFind is searched within the first string of StringStringStringStringStringstringVal, the first character of the second element of ToFindToFindToFindToFindToFindtoFind is searched within the second string of StringStringStringStringStringstringVal and so on. The results of the elementwise searches are returned with PositionPositionPositionPositionPositionposition that contains as many elements as StringStringStringStringStringstringVal and ToFindToFindToFindToFindToFindtoFind. If ToFindToFindToFindToFindToFindtoFind only contains one string, its first character is searched within all strings of StringStringStringStringStringstringVal. Thus, in this case PositionPositionPositionPositionPositionposition consists of as many elements as StringStringStringStringStringstringVal. If both input tuples contain more than one element and the number of elements differs for the input tuples, tuple_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr returns an error.

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_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr, which can be used in an expression in the following syntax:

Position := strchr(String, ToFind)



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

Input tuple with string(s) to examine.

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

Input tuple with character(s) to search.

PositionPositionPositionPositionPositionposition (output_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Position of searched character(s) within the string(s).


tuple_strrchrtuple_strrchrTupleStrrchrtuple_strrchrTupleStrrchrTupleStrrchr, tuple_strstrtuple_strstrTupleStrstrtuple_strstrTupleStrstrTupleStrstr, tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr, tuple_strlentuple_strlenTupleStrlentuple_strlenTupleStrlenTupleStrlen, tuple_substrtuple_substrTupleSubstrtuple_substrTupleSubstrTupleSubstr, tuple_str_first_ntuple_str_first_nTupleStrFirstNtuple_str_first_nTupleStrFirstNTupleStrFirstN, tuple_str_last_ntuple_str_last_nTupleStrLastNtuple_str_last_nTupleStrLastNTupleStrLastN, tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit, tuple_environmenttuple_environmentTupleEnvironmenttuple_environmentTupleEnvironmentTupleEnvironment



ClassesClassesClassesClasses | | | | Operators