Replace list items with Bathroom if they begin with BR-

I’ve a list of room room names. The bathroom room names are codes that begin with, BR-, WC-, ES-. I want to replace those codes in the list with “Bathroom”. Not sure how. Getting a bit too complicated. Whats the simplest way to do this?
The logic : If list item begins with “BR-” or “WC-” or “ES-” Then replace item with “Bathroom”

That’s the correct logic. What have you tried to accomplish it? This is just a traditional IF statement. You can look at it as 3 nested conditions or as a singular condition using multiple OR statements. See if you can get the OR statement for all 3 codes working and/or the singular resultant IF statement for true and false values. Once you have the two pieces working separately, it should be super easy to combine them into a single conditional.

That’s assuming you want the full room name to be replaced with “Bathroom”. If you want just the code portion of the name to be replaced with “Bathroom” and the rest of the room name to remain, then you’ll probably want to use String.StartsWith to see if any code exists and then strip the first 3 characters so that you can then add “Bathroom” to the beginning of the name.

Nah full room. I’m not used to making if statements and conditions in Dynamo. I’ve done this already using DiRoots one to select based on those conditions but would be helpful to see how someone might do this in Dynamo. I started using overly complicated nodes to try and do something very simple which a code block might have done. But I’m not familiar with Dynamo code

There’s a basic OR node (||) and a basic IF node. Start with those and see where you get. It should be easy enough to build on both of them once you get the basics figured out. You can also search for other topics on IF statements. Plenty of them deal with nested conditions.