You are viewing limited content. For full access, please sign in.

Question

Question

String TRIM options

asked on February 10, 2022

We are looking for a way to trim the first 4 characters of a token - we get a token from a Barcode value, we want to remove the first 4 characters - how do I do a LEFT TRIM, 4 characters.

 

We were using a substitution approach but are seeing bugs when the pattern matches multiple times in the complete string.

 

Eg:   20220378839 TRIM 4 LEFT to become:  0378839

 

Currently our substitution approach does a find 2022 and replace with empty, great except when 2022 appears twice in the same string.

 

0 0

Replies

replied on February 10, 2022

You could run it through a Pattern Matching process. Something like \d{4}(.+) will ignore the first 4 digits and extract everything else.

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.