I'm working with an address database. For further cleaning I need to identify the leading zeros that are stored in the string containing the door number. So a clean and friendly case would be something like 7/5
- where 7 would be the house number, 5 the door number.
The problem is that in some cases, there are leading zeros involved - not only at the beginning of the string, but also in the middle. And of course, there are also "normal" and necessary zeros. So I could have an address like 7/50
, where the zero is totally fine and should stay there. But I could also have 007/05
, where all the zeros need to go away. So the only pattern I can think of is to check wheter there is a number greater than zero before that zero. If no, then delete that zero, if yes, keep it.
Is there any function to achieve something like this? Or would this require something custom built? Thanks for any suggestions!