Skip to content

tuple_str_last_nTupleStrLastNTupleStrLastNtuple_str_last_ntuple_str_last_nšŸ”—

Short descriptionšŸ”—

tuple_str_last_nTupleStrLastNTupleStrLastNtuple_str_last_ntuple_str_last_n — Cut all characters starting at position ā€œnā€ out of a string tuple.

SignaturešŸ”—

tuple_str_last_n( string String, number Position, out string Substring )void TupleStrLastN( const HTuple& String, const HTuple& Position, HTuple* Substring )static void HOperatorSet.TupleStrLastN( HTuple stringVal, HTuple position, out HTuple substring )def tuple_str_last_n( string: MaybeSequence[str], position: MaybeSequence[Union[float, int]] ) -> Sequence[str]

def tuple_str_last_n_s( string: MaybeSequence[str], position: MaybeSequence[Union[float, int]] ) -> strHerror tuple_str_last_n( const char* String, const Hlong Position, char* Substring )

Herror T_tuple_str_last_n( const Htuple String, const Htuple Position, Htuple* Substring )

HTuple HTuple::TupleStrLastN( const HTuple& Position ) const

HTuple HTuple.TupleStrLastN( HTuple position )

DescriptionšŸ”—

tuple_str_last_nTupleStrLastN cuts all characters from position ā€œnā€ to the end of the string out of each string of the input tuple StringstringValstring and returns them as new strings in the output tuple Substringsubstringsubstring. The position ā€œnā€ is determined by the second input tuple Positionpositionposition. If Positionpositionposition only contains one element, this element contains ā€œnā€. If StringstringValstring and Positionpositionposition have got the same number of elements, the first element of Positionpositionposition determines the start position for the first string of StringstringValstring, the second element of Positionpositionposition does so for the second string of StringstringValstring and so on. If Positionpositionposition contains more than one element and StringstringValstring contains only one string, tuple_str_last_nTupleStrLastN cuts more than one substrings out of this string. The elements of Positionpositionposition then determine the start positions for these substrings. If both input tuples contain more than one element but differ in the number of elements, tuple_str_last_nTupleStrLastN returns an error.

If both input tuples are empty, the operator returns an empty tuple. Similarly, if StringstringValstring is empty and Positionpositionposition is not, the operator returns an empty tuple. In contrast, if Positionpositionposition is empty and StringstringValstring is not, an exception is raised.

Unicode code points versus bytesšŸ”—

The position references Unicode code points. One Unicode code point may be composed of multiple bytes in the UTF-8 string. If the position should reference the raw bytes of the string, this operator can be switched to byte mode with set_system('tsp_tuple_string_operator_mode','byte'). If 'filename_encoding'"filename_encoding" is set to 'locale'"locale" (legacy), this operator always uses the byte mode.

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

HDevelop In-line OperationšŸ”—

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

Substring := str_lastn(String, Position)

Execution informationšŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersšŸ”—

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

Input tuple with string(s) to examine.

Positionpositionposition (input_control) number(-array) → (integer / real)HTuple (Hlong / double)HTuple (int / long / double)MaybeSequence[Union[float, int]]Htuple (Hlong / double)

Input tuple with position(s) ā€œnā€.

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

The last characters of the string(s) starting at position ā€œnā€.

Combinations with other operatorsšŸ”—

Combinations

Alternatives

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

ModulešŸ”—

Foundation