# Split Datatype "String" to a String-List

**URL:** <https://forum.universal-robots.com/t/split-datatype-string-to-a-string-list/19393>\
**Category:** General Application Help: How do I?\
**Created:** [February 21, 2022, 6:57am UTC](https://forum.universal-robots.com/t/split-datatype-string-to-a-string-list/19393 "2022-02-21T06:57:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eikefranke](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eikefranke](https://forum.universal-robots.com/u/eikefranke)\
**Post date:** [February 21, 2022, 6:57am UTC](https://forum.universal-robots.com/t/split-datatype-string-to-a-string-list/19393/1 "2022-02-21T06:57:00Z")

</div>

Hi all,  
for a communication between the Cobot UR5e and a PC, I send a Strink like “PC Cobot Move-to-point-A” to the Cobot  
It is Important, to seperat al the Words to work with this input.  
so I need to split the string on Cobotside to work with the message.

how can i do it?

or is ther an another opinion to make the communication flexibel:  
-Cobot need to communikate with one to three PC´s over Socket-Communication.  
-in this moment all components work with static IP´s. A DHCP-Server will install soon, but the IP of the cobot will be static. (so i can find the cobot easily)  
-only one Cobot per LAN-System  
-It is important, to know witch PC send the measseg to the cobot, so the Cobot can do the work well.

---

<div class="post-metadata">

**Author:** ![anon32693620](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@anon32693620](https://forum.universal-robots.com/u/anon32693620)\
**Post date:** [February 21, 2022, 2:27pm UTC](https://forum.universal-robots.com/t/split-datatype-string-to-a-string-list/19393/2 "2022-02-21T14:27:01Z")

</div>

If you are doing this on the script side you could look at using the functions “str\_len”, “str\_sub” and “str\_find”. Using these three functions you can split the string up by looking for specific characters which in this case could be the space between each word. If you are doing this on the Java side or a python daemon, then you can use split function of a String.
