ChunkText function
Syntax
ChunkText(string, delimiter [, chunk_size])
Description
Use the ChunkText function to break a long text string into chunks that can be more readily managed by a storage system, such as a database text field. You must specify a string delimiter; the chunk size is optional.
Parameters
| Parameter | Description |
|---|---|
|
string |
Specify the text to be split into chunks as a string. |
|
delimiter |
Specify a single character as a text delimiter. |
|
chunk_size |
Specify the chunk size in characters as a number. If you specify no value, 0, or a number greater than 14000, the default value of 14000 is used. |
Returns
An array of string.
Example
Local array of string &chunkList;
&STRINGTOCHUNK = "NewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYorkNewYork";
&DELIM = "r";
&CHUNKSIZE = 8;
&chunkList = ChunkText(&STRINGTOCHUNK, &DELIM, &CHUNKSIZE);
The preceding example produces the following 16 chunks:
[NewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYor][kNewYork]
Related Topics