How to retrieve a substring BEFORE a delimiter in a previous field?

I have a field pulled from reference data such as, COUNTRYNAME / TIMEZONE. I need to extract the country name for the next field.

I’ve read that I can use regular expressions or ruby code but so far I haven’t figured out how.

  1. Can I use regexp to extract the desired string or is regex only used to create new values and not manipulate existing values.

  2. I tried to split the string using ruby string.split but was told 'String" is not found.

After getting neither option to work I took a step back to see if I could simply determine the position of the “/” character.
I tried this: regiona(string.index(“A”)) But again, got the error “String Not Found”

Obviously I’m missing something fundamental in the mechanism for performing operations on generated data.

Any suggestions?

Thanks,
-jeff

Assuming you have a field named “time_zone” you can access the country part using a formula field with the following value:

time_zone.split(/\//)[0]