SPLIT_PART

Extracts a specific part of a text string using a delimiter

Description

The SPLIT_PART() function is used to extract a specific part or segment of a text string by splitting it based on a specified delimiter. This function is handy for tasks like separating text data into structured components.

Syntax

SPLIT_PART(text, delimiter, part)

  1. text: The input text string that you want to split into parts.

  2. delimiter: The character or substring that is used to separate the text into parts.

  3. part: The part number (integer) you want to extract from the split text.

Example

Table

ID
Text

1

John,Smith,35

2

Apple

3

Red, Green, Blue

Function

SPLIT_PART(`Text`, ',', 2)

Results

SPLIT_PART (text)

Smith

Green

Last updated