# str2oct

This function converts a charstring value to an octetstring. The input shall contain even number of characters, where each character represents the value of one hexadecimal digit of the resulting octetstring. A dynamic test case error occurs if the length of charstring is odd or one or more of its characters are outside the ranges "0" .. "9", "A" .. "F" or "a" .. "f".

Note: Some earlier versions of the TTCN-3 Core Language standard contained the description of function char2oct incorrectly under the name str2oct.

Related keyword:

- octetstring
- charstring
- char2oct

### str2oct(charstring value) return octetstring

Example 1:

const octetstring c_duebel := str2oct("00DeadBeef12");

The constant called c_duebel will have the value '00DEADBEEF12'O.