String.Replace one specific number

Hi,

is it possible to make dynamo replace a number - and only if the number “stands alone”.

Example:
Every time the value is 0 it has to replace 0 with xx.
But when the value is 100 or 200 it should NOT replace anything.

I have made this script, where it replaces all 0’s no matter if it is a part of another number og stands alone.

@mee

1 Like

You can do the same thing @salvatoredragotta suggested with nodes as well and they don’t even need to be strings. The main point is that you want to check and replace the item, not the string value.
image

4 Likes

@Nick_Boyts Thanks, that worked! :slight_smile: Easier than I thought