Chapter 4 Advanced Expressions: Evaluating Text 89
Operations on a Portion of a String

You can extract a subset of a larger string using one of the operations in the

following table.

text.SUFFIX(character,
count)Selects the longest suffix in the target that has at
most count occurrences of character.
For example, consider the following response
body:
JLEwx
The following expression returns a value of
“JLEwx”:
http.res.body(100).suffix('L',1)
The following expression returns “LLEwx”:
http.res.body(100).suffix('L',2)
text.SUBSTR(starting_
offset, length)Select a string with length number of characters
from the target object. Begin extracting the string
after the starting_offset. If the number of
characters after the offset are fewer than the value
of the length argument, select all the remaining
characters.
text.SKIP(character, count)Select a string from the target after skipping over
the longest prefix that has at most count
occurrences of character.

Basic Operations on a Portion of a String

Basic Text Operation Description
text.BEFORE_
STR("string") Returns the text that precedes the first occurrence of string.
If there is no match for string, the expression returns a text
object of 0 length.
Following is an example:
http.res.body(1024).after_str("start_
string").before_str("end_string").
contains("https")
text.AFTER_
STR("string") Returns the text that follows the first occurrence of string.
If there is no match for string, the expression returns a text
object of 0 length.
Following is an example:
http.res.body(1024).after_str("start_
string").before_str("end_string").
contains("https")

Operations on Strings Based on a Character Count

Character Count Operation Description