cancel
Showing results for 
Search instead for 
Did you mean: 

extract specific character from string

0 Kudos

Hello Experts,

I am trying to extract specific character from a string field. Data format example:

/southwest/science/samuel, john, 23445/

/northwest/english/larry, dan, 38543/

from above i just need to extract Science and English.

Your help will be appreciated.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Assuming they are always in front of the third / this will give you what you want, replace text with your field

split('/southwest/science/samuel, john, 23445/','/')[3]

Ian

0 Kudos

Hi Ian,

Thanks for the quick response, is there a way to count it from the reverse order? Some of the records have blank spaces before /.

Former Member
0 Kudos

try (all single quotes in example), this remove spaces before doing split

split(replace({yourfield},' ', ''),'/')[3]

Ian