Getting Started > Use Lua Scripts > Method Reference > String Methods

String Methods
gobble_whitespace
Reduces multiple adjacent white spaces (tab, carriage return, space, and so on) in the specified field to a single space.
Syntax
String gobble_whitespace (String Input)
Arguments
 
Returns
A string without adjacent white spaces.
hash_string
Hashes the specified string using the SHA1 or MDA5 algorithm.
Syntax
String hash_string (String StringToHash, String Algorithm)
Arguments
 
Returns
The hashed input string.
parse_csv
Parse the given separated values string into a collection of individual strings.
Syntax
parse_csv( csv_string [, delimiter])
Arguments
 
Discussion
The method understands quoted values (such that parsing 'foot, "leg, torso", elbow' produces three values) and ignores white space around delimiters.
Returns
The elements are returned as multiple return values. You may wish to put them in a table like this:
local results = { parse_csv("cat,tree,house", ",") };
parse_xml
Parse the given XML string to an XMLDocument.
Syntax
parse_xml( xml_string )
Arguments
 
Discussion
This requires the XSLT dll (autnxslt.dll/libautnxslt.so).
Returns
An XMLDocument containing the parsed data, or nil if the string could not be parsed.