Using ExtractString to pull Issue Key Prefix

I have Issue Keys with varying lengths of prefixes such as ABCD-123, or ABCDEF-123. How can I use the ExtractString command to pull the prefix to the left of the dash ‘-’?

I would like ABCD-123 and ABCDEF-123 to return ABCD and ABCDEF.

Any help using this command would be appreciated

Thanks