split method: Utility class
Syntax
split()
Description
Use this method to extract the elements from the string that are enclosed in the specified tag.
Parameters
| Parameter | Description |
|---|---|
|
String |
Specifies the string to check. |
|
Tag |
Specifies the tag to search for as a string. |
Returns
An array of string containing the string elements enclosed by the specified tag.
Example
import PTFP_FEED:UTILITY:Utility;
Local PTFP_FEED:UTILITY:Utility &utility = create PTFP_FEED:UTILITY:Utility();
&str = "<p>value1</p><p>value2</p>";
&arr = &utility.split(&str, "p");
/* &arr[1]="value1", &arr[2]="value2" */
Related Topics