Str2con() Function in Container | X++ Language
Table of Content:
- This a Global class method which converts the string elements into a container. The returned string cannot have more than 1000 characters.
- Syntax: client server public static container str2con(str _value, [str _sep])
- -value - the String
- sep - The string to use as a separator between elements; optional.
- Return: A container.
Example:
Code:
static void Container_str2ConExample(Args _args) { container containerName; // container declaration str charHolder; int conLength, cnt; ; // str2Con() function gets values str comma separated and converts to container // container initialization with 2 values using str2con() containerName = str2con("Technical,Functional", ","); info(strFmt("Container containerName str2con() values are :- %1 and %2", conPeek(containerName, 1), conPeek(containerName, 2))); }
Output:
The above code will produce the following result-
Container containerName str2con() values are :- Technical and Functional