If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Find a string between two symbols

Started by sunily, 13 Jul 2018 04:30:55 AM

Previous topic - Next topic

sunily

Hi,

I know this is a noob question and might be asked few times in this forum.

I want to extract a string between two symbols.

For eg: A_B_C_D

I want to extract B from this. There might be less or more _ in string and length of A,B,C,D is not fixed.

BigChris

For the sake of clarification, are you looking for the first _ and the character(s) between that and the next _ ?

sunily


sunily

#3
Looks like I got it:

substring_index(substr(zoneName, locate('_',zoneName)+1,locate('_',zoneName)-1),'_',1)

Please validate or suggest better way

sdf

are you always gonna get the 3rd string?

is substring([zoneName],3,0)

an option?