Chapter 4 Advanced Expressions: Evaluating Text 89

Operations on Strings Based on a Character Count

Character Count Operation

Description

 

 

text.SUFFIX(character,

Selects the longest suffix in the target that has at

count)

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_

Select a string with length number of characters

offset, length)

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.

 

 

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.

Basic Operations on a Portion of a String

Basic Text Operation

Description

 

 

text.BEFORE_

Returns the text that precedes the first occurrence of string.

STR("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_

Returns the text that follows the first occurrence of string.

STR("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")

Page 103
Image 103
Citrix Systems 9.2 manual Basic Operations on a Portion of a String, Character Count Operation Description