Drop leading zeros

I don’t know if this is possible with bubble, but if I have a text input and what I’m trying to do is eliminate/drop the leading zeros and save the rest
Example: User types in 0000001234567890, I want bubble to drop the zeros and save: 1234567890 to the database or user types in 00100abc0000, I want bubble to drop 00 and save 100abc0000 to the database

I converted the field to a number as @atomicfusion suggested yesterday and it worked for one case, but its not working for the second case when user enters 00100abc0000, instead of saving 100abc0000 to the database, its saving 1000000

How would I achieve this in bubble, is this possible?, thanks
Thank you

1 Like

Hi there, @phoenixideas3… if you do a find and replace with this regex pattern (note that you should leave the Replace by field empty), you should get the desired result.

Even though it’s only 3 characters, here is the pattern if you want to copy it: ^0+

Hope this helps.



Hi there,

Try to use find and replace expression, with regex pattern enable and use “^0+” (without quotes)
and replace with noting (leave blank).

@mikeloc was a minute faster than me :slight_smile:


Thank you, works now :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.