[SOLVED] Problem with upper and lower case

Thank you… I meant to include this…

I have a DSL version committed to the helper library docs…

            import org.eclipse.smarthome.model.script.ScriptServiceUtil

            rule "Test DSL rule"
            when
                System started
            then
                val item_name_to_find = "Virtual_String_1"
                var GenericItem matching_item = null
                for (item : ScriptServiceUtil.getItemRegistry.getAll()) {
                    if (item.name.toLowerCase == item_name_to_find.toLowerCase) {
                        matching_item = item as GenericItem
                    }
                }

                if (matching_item !== null) {
                    logWarn("Rules", "Item found: [{}]", matching_item)
                } else {
                    logWarn("Rules", "Item not found")
                }
            end
3 Likes