cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting part of a string with a delimiter

Former Member
0 Kudos

Hi. Is there a function that can take the string below, and extract EITHER everything to the left OR the right of the " | " separator? I have many string fields with the same format and need to split them apart. They all contain the same separator but I haven't come across anything that works.

Thanks.

"Communication | 6. Invites feedback, discussion and/or suggestions about his/her own ideas and assumptions"

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi,

Use this formula to extract everything to the left of "|" :

left(, Instr(, "|")-1);

And, use this formula to extract everything to the right:

Mid(, Instr(, "|")+1, length()); You can even do this using an array: stringvar array a; a := split(, "|");

a[1];

a[1] would have everything to the left of "|" and a[2] would have everything to the right of the "|".

Hope this helps!

-Abhilash

Former Member
0 Kudos

Thanks! that worked great!

Answers (1)

Answers (1)

former_member292966
Active Contributor
0 Kudos

Hi,

You can use the Split function. This will convert your string to an array with a defined seperator like:

StringVar myString; 

myString := "Communication | 6. Invites feedback, discussion and/or suggestions about his/her own ideas and assumptions" 
 
Split (myString, "|") [1];

This will retrieve the first element in the array which is "Communication ".

Good luck,

Brian