Home > User Voice > [WORK-AROUND]: ERROR WITH STRING REPLACE in Version 2023.1.3.29 (Form Field -> Style and behavior)

[WORK-AROUND]: ERROR WITH STRING REPLACE in Version 2023.1.3.29 (Form Field -> Style and behavior) UNDER REVIEW
1

MVP

Hello,

in the 2023.1.3.29 version, we have apparently identified a reproducible bug.

In our case we are using a text field to store a time value. The goal is for this to automatically replace a period ('.') with a colon (':') after input (Style and behavior).

The error occurs when we attempt to replace every period ('.') with another character using STRING REPLACE, specifically in the case of "15.00" where we want to replace each period ('.'). Instead of just replacing the periods, ALL characters are replaced with the replacement character.

Consequently, replacing '.' with ':' results in ':::::', and replacing '.' with '14' leads to '1414141414'.

I have documented this issue very clearly in the attached graphic. The error occurred in an existing application but was also reproduced in a separate test app.


Thanks for checking,
Bjoern Poller
Josef Raedlinger Group

MVP

Hi Björn,

the string replace uses a regular expression in the background.

You can simply escape the dot with a \ so that the regular expression looks for the dot character and not for any character.
It looks a little strange int eh designer studio though.

@Michał
I hope they are not changing this behavior. Using the string replace in combination with regular expression came in handy. :)

Best regards,
Daniel

MVP
In reply to: Daniel Krüger (Cosmo Consult)

Hi Björn,

the string replace uses a regular expression in the background.

You can simply escape the dot with a \ so that the regular expression looks for the dot character and not for any character.
It looks a little strange int eh designer studio though.

@Michał
I hope they are not changing this behavior. Using the string replace in combination with regular expression came in handy. :)

Best regards,
Daniel

.▀█▀.█▄█.█▀█.█▄.█.█▄▀ █▄█.█▀█.█─█
─.█.─█▀█.█▀█.█.▀█.█▀▄ ─█.─█▄█.█▄█

Daniel,

that is a nice work around. Perfect.

For all with the same trouble:
You maybe have to copy the backslash '\' from another source. In my case, i was not able to write it manual in the field, but i could insert it with CTRL+V (eg directly out of Daniels post ;-) ).

Now it works!

So far, so good. I am not sure if there should be a permanent solution or at least a hint in the hovered info box.

<german> Super Tipp und große Hilfe Daniel! </german>

Bjoern