GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Eight — Data Functions (continued)
Overview
The ExplodeString function separates string components into an array of strings based on a delimiter string.
Syntax/Parameters
Syntax
string[] = ExplodeString ( string data, [string delimiter], [int limit] );
Parameters
data
A string containing data to explode.
delimiter
An optional string that defines the delimiter that will be used to separate the string. The delimiter segments are not placed in the resulting array except for the last item in certain circumstances. If the delimiter is omitted or an empty string is provided, the data string is treated as lines of text separated by “\r” or “\r\n”.
limit
An optional int specifying a limit to the number of items to explode. If omitted, all segments between matching delimiters are placed in the array. If a positive number is used, the array will be filled with a maximum of that number of items plus a last item containing remaining unprocessed data, if any. If a negative number is provided, the array will be filled with a maximum of that number of items and any remaining data will be discarded. The value cannot be 0 and a delimiter must be provided to use this parameter.
Return Value
Returns a string array containing each string segment and potentially a last entry with any remaining unprocessed data.
Remarks
The ExplodeString function is an extremely powerful string processing tool. It can be used to read in and index a file by lines. Scripts can also explode sections of a string to the limit parameter and then process the remaining data from the last item at the limit position. However, for reading certain uncontrolled data types such as when parsing CSV data, this function is not sophisticated. For example, the CSV functions will take into account escape quotes while this function will treat all quotes in the same manner.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.