STRPART() extracts a specific section from a string by dividing it into parts based on specified delimiter characters. If no delimiters are provided, the function uses spaces as the default separator. This function is useful for parsing structured strings, extracting specific parts of text, and handling delimited data.
STRPART(string, section number [, list])
STRPART() returns a character string
// Single character delimiter
STRPART("12/25/2002", 1, "/") = "12"
STRPART("12/25/2002", 2, "/") = "25"
STRPART("12/25/2002", 3, "/") = "2002"
// Default space delimiter
STRPART("APPLES AND ORANGES", 1) = "APPLES"
STRPART("APPLES AND ORANGES", 2) = "AND"
STRPART("APPLES AND ORANGES", 3) = "ORANGES"
// Multiple character delimiters
STRPART("APPLES, AND ORANGES", 1, "S, ") = "APPLE"
STRPART("APPLES, AND ORANGES", 2, "S, ") = "AND"
STRPART("APPLES, AND ORANGES", 3, "S, ") = "ORANGE"
// Additional examples
STRPART("A:B:C:D", 2, ":") = "B" // Simple delimiter
STRPART("First|Second|Third", 3, "|") = "Third" // Pipe delimiter
STRPART("Part1-Part2-Part3", 1, "-") = "Part1" // Hyphen delimiter