How to convert all the spaces in an input to underscores

Here for this input i want to covert all the spaces to underscores
Kindly guide

Hi there, @Posybl… I’m not sure what you are doing with that condition and I don’t pretend to know much about regex, but if you are simply trying to replace spaces with underscores, uncheck the regex box and literally type a space character in the Text to find field, and you should be good to go.


yeah i just want to convert all spaces into underscores but i don’t have proper knowledge about find and regex.
kindly guide exactly where i will make changes.
thank you! @mikeloc

As I said, you don’t need to use regex. Simply uncheck the regex box and type a space character in the Text to find field.

The above being said, where/when do you want the spaces to be changed to underscores? Right now, you are trying to do it in a condition, and I’m not sure that makes sense. Can you describe what you want from a user perspective?

@mikeloc yeah i know that it’s not making a sense.
simply i just want that whenever a user wants to write a sentence then spaces will be auto converted to underscores.
for example if he want to write “I will be there”. then it should be auto converted to “I_will_be_there”.

Okay, but converted where? As they type it in the input? When it gets saved to the database? When it is displayed on the front end somewhere else?

yeah i am saving it in database.
then displaying in another group.

Okay… when you save it to the database, save the input’s value to the appropriate field, and add the :find & replace operator to the expression where you are saving the value. So, it will be something like field = input's value:find & replace, and do a find of a space character and replace with an underscore.

Got it.
Thank you!

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