Pick first word from string

I am having a column containing values in the format like
ADE-437
RE-4356(RTY)
TUIO-587
ERT-45

I want the output like
ADE
RE
TUIO
ERT

What should i do ?
Please help

Hi @Swara_Soni

you can use spilt function to spilt with’-’

from list of array you can take the index0 value, you will get first words.

thanks
Latika

1 Like

A regex that would work would be
.*(?=-)

1 Like

@Gabriele_Camilli How would i use it in the query ?
My assign activity equals this :
System.Text.RegularExpressions.Regex.Replace(str, “.*(?=-)”, " ")

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.