Skip to content

__split

JMeter __split function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

Also documented in context in the full Functions and Variables reference.

The split function splits the string passed to it according to the delimiter, and returns the original string. If any delimiters are adjacent, โ€œ?โ€ is returned as the value. The split strings are returned in the variables \${VAR_1}, \${VAR_2} etc. The count of variables is returned in \${VAR_n}. A trailing delimiter is treated as a missing variable, and โ€œ?โ€ is returned. Also, to allow it to work better with the ForEach controller, __split now deletes the first unused variable in case it was set by a previous split.

Example:

Define VAR=โ€œa||c|โ€ in the test plan.

Terminal window
\${__split(\${VAR},VAR,|)}

This will return the contents of VAR, i.e. โ€œa||c|โ€ and set the following variables:

VAR_n=4

VAR_1=a

VAR_2=?

VAR_3=c

VAR_4=?

VAR_5=null

NameRequiredDescription
String to splitYesA delimited string, e.g. โ€œ`a
Name of variableYesA reference name for reusing the value computed by this function.
DelimiterNoThe delimiter character, e.g. `
On this page