• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

How to replace a zero with the number 1, but not in the middle of a number.

karilynae

Member
I'm using Text formatter: replace text to look for a zero and replace it with a 1. But I only want to replace it if the number is actually zero, not in the middle of a number like 205. Is there a way to do this?
 

ArshilAhmad

Moderator
Staff member
Hi @karilynae,

Please try using this Python code to achieve your use case.
1723146456359.png


Python:
def replace_zero(num):
    # Check if the number is exactly 0
    if num == 0:
        return 1
    else:
        return num

# Test cases
print(replace_zero(205))

 
Top