Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

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
16 - Nebula
16 - Nebula

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
Top Solution Authors