Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Trimming characters from the middle of a string

Blondek
7 - Meteor

Hi community, 

 

I'm trying to remove the text from the middle of a string. I've managed to trim characters from both the left and the right already. 

 

What looked like this: CAT_CAT_0107_03_03_000 now looks like CAT 0107, but I need it to look like 'CAT107'. 

 

The data type is string and needs to remain string. 

 

Thanks a lot in advance, 

 

Matt

3 REPLIES 3
fmvizcaino
17 - Castor
17 - Castor

Hi @Blondek ,

 

I'm not sure if I'm simplifying your problem, let me know if I'm doing it.

fmvizcaino_0-1583855649617.png

 

 

Best,

Fernando Vizcaino

OllieClarke
15 - Aurora
15 - Aurora

Regex_replace([Field],' 0*','')

This will remove any spaces and any zeroes preceded by a space

Blondek
7 - Meteor

This worked perfectly, thank you! 

Labels