How can I replace any string in a list with a number?

Hello there, first time posting here!

Simple question I think, is there a way to detect string items in a list of number values and convert those items into a “default” value e.g. 10? How?

Example:
{ 110, 30, “W10X10”, 15, 42, “pw”, 18, “rwk”, “ph66”, 77 }

into this:

{ 110, 30, 10, 15, 42, 10, 18, 10, 10, 77 }

Thanks in advance!

Object.Type

1 Like

Thank you, Andreas, I think I’m almost there, only a simple problem:

What might I be doing wrong here?

Replace.ByCondition works as a function which means that the Object.Type node shouldn´t be conected to the list. Anyway that won´t work either (I guess functions have to be simpler). You could try somethins like this:


You have to use the ReplaceItemAtIndex in the Clockwork package since the OOTB node replaces just one element.

2 Likes