Strpart()

Home   Back   Next  

Working with Formulas > Functions Used in Formulas > Text Functions > Strpart()

 

STRPART() divides a string into parts by the characters specified in the list and returns the nth section. If no characters are listed, the function uses a space as the default character to separate the string.

 

 

Function Format

 

STRPART(string, section number [, list]) 

 

 

Return Value

 

STRPART() returns a character string 

 

 

Examples

 

Single Character delimiters:

 

STRPART("12/25/2002", 1, "/") = "12" 

 

STRPART("12/25/2002", 2, "/") = "25" 

 

STRPART("12/25/2002", 3, "/") = "2002" 

 

 

No delimiter specified (space is used by default):

 

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"