cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing Characters In a String

Former Member
0 Kudos

I have a string field that I need to shorten - typical data looks like '123456-789 XYZ' I can get rid of the XYZ as it is always in the 18,19,20th positions in the string. I need to shorten the field to '123456' but the dash isn't always in the same spot. Can I use the REPLACE function to get rid of everything after the "-"?

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Layne,

Use this formula:

left({string_field},instr(string_field,"-")-1)

//This will get rid of the 'XYZ' as well

Hope this helps!

-Abhilash

Former Member
0 Kudos

That did the trick!

Thanks

Answers (0)