The following snippets are meant to show how to extract the individual elements from a string with fixed separators.
Variant 1: Convert the string to a container using str2con()
static void Job1(Args _args) { str paramAsStr = "Wert1@@Wert2@@Wert3"; container paramAsCon; int i; paramAsCon = str2con(paramAsStr, "@@"); for (i=1;i<=conLen(paramAsCon);i++) { info(conPeek(paramAsCon, i)); } }
Variant 2: Convert the string to a list using strSplit()
static void Job1(Args _args) { str paramAsStr = "Value 1|Value 2|Value 3"; List paramAsList; ListEnumerator le; paramAsList = strSplit(paramAsStr, "|"); le = paramAsList.getEnumerator(); while(le.moveNext()) { info(le.current()); } }
The following snippets are meant to show how to extract the individual elements from a string with fixed separators.
Variant 1: Convert the string to a container using str2con()
Variant 2: Convert the string to a list using strSplit()