Titan



replace


This function replaces the substring or subsequence of value/template inpar at index index of length len with the string or sequence value/template repl and returns the resulting string or sequence. inpar shall not be modified. If len is 0 the string or sequence repl is inserted. If index is 0, repl is inserted at the beginning of inpar. If index is lengthof(inpar), repl is inserted at the end of inpar. inpar and repl, and the returned string or sequence shall be of the same root type. The function replace can be applied to bitstring, hexstring, octetstring, or any character string, record of, set of, or array. Note that the indexing in strings starts from zero. (For more information check ETSI ES 201 873-1 (TTCN-3 Core Language).)


Related keyword:


replace (in any_string_or_sequence_type inpar, in integer index, in integer len, in any_string_or_sequence_type repl) return any_string_or_sequence_type


Example 1:

var charstring v_nyilatko := replace( "My name is JJ", 11, 1, "xx" );

The variable v_nyilatko will contain the charstring value "My name is xxJ".