[Issue] Removing spaces from text body

Hi there,

I am looking for a way to remove all spaces from texts. Not looking to remove spaces from the start/end of a string, but looking to remove all spaces from the string.

Anyone know how to do this natively within Bubble?

I did see a forum suggestion elsewhere that Blockspring might be able to do it, but looking for an internal/Bubble solution first. @emmanuel , do you think this is a function you guys could add?

Thanks,
P

1 Like

What is the use case here? That sounds very specific, not sure we want to add an option for this as it’s very rare and Blockspring does the job (and soon the plugin system).

I would use it for users’s @HandleName

The use case is to compare text strings without having spaces throwing off match/no match determinations.

Thanks,
P

We’re pushing a more generic function that will let you do a find and replace in a text. The way it works is consistent with other operations on text. In the dropdowns pick ‘:find/replace’ and you’ll be able to define the find and replace fields (can even be dynamic, which opens up quite some possibilities).

If your case you’d say: find: ’ ’ replace ‘’

5 Likes

Awesome - that’s extremely useful and will help with several other data tasks.

Thanks so much!

P

1 Like

Just thought of something - can you guys enable ‘wildcards’ as part of the find/replace.

This would be HUGELY useful…

Thanks,
P

What do you mean exactly?

I mean allow text in between two words to be caught by a ‘*’ (or some other wildcard).

If I wanted to find and replace this paragraph, I would have to know what was in it and then insert the entire paragraph into the find/replace. But if you enabled wildcards I could simply do it by finding/replacing the following:

If * following:

This solves many many many problems with text.

Thanks,
P

So I made it so that you can use Regex (or a simple text) to find. That’s a bit more technical, but that means you can do something like this.

3 Likes

Fantastic. Thanks!!!

P

Hi, just testing out the feature.

Think you guys could enable the ‘line_break’ function? Would be great to replace commas, semi-colons etc. with line breaks. I don’t think this is enabled?

Thank you!

P

We’ll push this later today.

1 Like

Great - Thanks!

P

hello,

can somebody maybe explain how I would use regex with find & replace?

I have this regex:

~(?:\b)((?=[0-9a-z]*\d)[0-9a-z]{10})(?:\b)~i

and I want to extract the ASIN from an amazon URL like this for example:

> https://www.amazon.com/Sigmasport-computer-frequency-Computer-monitors/dp/B0060RLN8A/ref=pd_rhf_gw_p_img_6?ie=UTF8&psc=1&refRID=RWFE82CN033Z93SX96C3

I have the regex from:

Hi -

For each RG cell, I have an object (shape) visible/invisible based on this conditional: compare the cell’s text to an API’s text string in the same cell.

The Find&replace option is only enabled for 1 text, and I need both of them, which Bubble doesn’t enable.

Example A:
When Current cell’s text…Find&Replace is not API.idx.text

works just fine,

but:

When Current cell’s text…Find&Replace is not API.idx.text works…FIND&REPLACE

does not (there is no option to enable this 2nd find&replace).

Note that the issue is not about the API.text vs the cell text. For example, I can reverse the argument fine:

When API.idx.text…Find&Replace is not Current cell’s text

works just fine,

but

When API.idx.text…Find&Replace is not Current cell’s text…FIND&REPLACE

does not (there is no option to enable this 2nd find&replace).

Do you think we could enable this? Alternatively, is there another solution?

Thanks,
P

How did you do that? When I tried to create multiple input find and replace the other ones did not work. For example: A contract with find and replace fields mapped out in which i can just quickly fill out inputs replace the fields needed quickly and in realtime on the page?