# String operations

**URL:** <https://community.openhab.org/t/string-operations/22805>\
**Category:** Scripts & Rules\
**Tags:** strings, rules\
**Created:** [February 12, 2017, 6:47pm UTC](https://community.openhab.org/t/string-operations/22805 "2017-02-12T18:47:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [February 12, 2017, 6:47pm UTC](https://community.openhab.org/t/string-operations/22805/1 "2017-02-12T18:47:11Z")

</div>

Is it possible to do string manipulations within a rule?  
I need to build a string out of elements of a String-ArrayList seperated by “,”.

---

<div class="post-metadata">

**Author:** ![lipp\_markus](https://community.openhab.org/user_avatar/community.openhab.org/lipp_markus/32/56218_2.png) [@lipp\_markus](https://community.openhab.org/u/lipp_markus)\
**Post date:** [February 12, 2017, 6:52pm UTC](https://community.openhab.org/t/string-operations/22805/2 "2017-02-12T18:52:23Z")

</div>

the quick answer is yes  
As I am just happen to look at some of this, you may want to check out this post where group names are reconstructed in a rule:

> [@Design Pattern: Working with Groups in Rules](https://community.openhab.org/t/design-pattern-working-with-groups-in-rules/20512):
>
> Edit: Updates for OH 4, inclusion of JS Scripting and Blockly examples, removed the doors example as it’s superfluous. Please see [Design Pattern: What is a Design Pattern and How Do I Use Them](https://community.openhab.org/t/design-pattern-what-is-a-design-pattern-and-how-do-i-use-them/40319) for how to read and use DPs. Problem Statement One powerful way to consolidate code in rules is to use array/list manipulation operations on the members of a Group. For example, filter down to just those members that are ON, get a list of the labels of those Items that are NULL, etc. Concept T…

and this post here:

> [@Configurable scenarios](https://community.openhab.org/t/configurable-scenarios/10140/3):
>
> For who want to have ability to adjust configuration of scenarios in “runtime”, from the app, here you will find a working example of it. This is a stand-alone example, you have obviously to modify something to integrate it in your system. First of all, light items, for example lights.items. // LIGHTS ITEMS & GROUPS Group gLights Switch Room1\_Light01 "Light 01" (gLights) Dimmer Room2\_Light02 "Light 02" (gLights) Switch Room3\_Light03 "Light 03 RGB" (gLights) Color Room…

where configurations are saved in a string file

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [February 12, 2017, 7:16pm UTC](https://community.openhab.org/t/string-operations/22805/3 "2017-02-12T19:16:03Z")

</div>

Thanks for the input, I didn’t know that StringBuilder was possible.
