# Dividing UART message into two variables

**URL:** <https://forum.arduino.cc/t/dividing-uart-message-into-two-variables/1164154>\
**Category:** Programming\
**Created:** [August 31, 2023, 11:01pm UTC](https://forum.arduino.cc/t/dividing-uart-message-into-two-variables/1164154 "2023-08-31T23:01:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [August 31, 2023, 11:41pm UTC](https://forum.arduino.cc/t/dividing-uart-message-into-two-variables/1164154/4 "2023-08-31T23:41:05Z")

</div>

> [@drakevimes](#):
>
> var1 = Serial.readStringUntil(";");

The readStringUntil() function is blocking and it uses the String class. Are you aware of the problems that the String class can cause with memory fragmentation?  
[The evils of Arduino Strings](https://hackingmajenkoblog.wordpress.com/2016/02/04/the-evils-of-arduino-strings/)

[The serial input basics tutorial](https://forum.arduino.cc/t/serial-input-basics-updated/382007) shows good ways to handle serial data.

Example 5 of the tutorial shows how to split values out delimited data with [the strtok() function.](https://cplusplus.com/reference/cstring/strtok/?kw=strtok)

---

_[View the full topic](https://forum.arduino.cc/t/dividing-uart-message-into-two-variables/1164154)._
