# Splitting tekst with {{' Variable'.split(';')\[2\]}} is removing the spaces

**URL:** https://community.homey.app/t/splitting-tekst-with-variable-split-2-is-removing-the-spaces/136619
**Category:** Questions & Help
**Created:** [May 17, 2025, 1:09am UTC](https://community.homey.app/t/splitting-tekst-with-variable-split-2-is-removing-the-spaces/136619 "2025-05-17T01:09:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CoonHouse](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/coonhouse/32/2764_2.png) [@CoonHouse](https://community.homey.app/u/CoonHouse)
#### Post date: [May 17, 2025, 1:09am UTC](https://community.homey.app/t/splitting-tekst-with-variable-split-2-is-removing-the-spaces/136619/1 "2025-05-17T01:09:55Z")

</div>

Hello,

I am trying to split a text variable with semicolons in them.

I used both “Logica” and “Better Logic”

Say the variable contains “Hello World;Good bye World” and use `{{‘Variable’.split(‘;’)[2]}} I get “GoodbeyWorld”.

Anyone knows a solution for this?

Thanks

---

<div class="post-metadata">

### Author: ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)
#### Post date: [May 17, 2025, 8:59am UTC](https://community.homey.app/t/splitting-tekst-with-variable-split-2-is-removing-the-spaces/136619/2 "2025-05-17T08:59:12Z")

</div>

You can use HomeyScript. There you can use the standard JS code:  
string.split( );

---

<div class="post-metadata">

### Author: ![CoonHouse](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/coonhouse/32/2764_2.png) [@CoonHouse](https://community.homey.app/u/CoonHouse)
#### Post date: [May 17, 2025, 9:39am UTC](https://community.homey.app/t/splitting-tekst-with-variable-split-2-is-removing-the-spaces/136619/3 "2025-05-17T09:39:49Z")

</div>

So it’s standard behavior? Strange.

Great. I didn’t think of HomeyScript.

Thanks.
