# Problem Saving Serial data into an Array

**URL:** <https://discourse.processing.org/t/problem-saving-serial-data-into-an-array/17003>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [January 10, 2020, 4:01pm UTC](https://discourse.processing.org/t/problem-saving-serial-data-into-an-array/17003 "2020-01-10T16:01:59Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [January 11, 2020, 3:40pm UTC](https://discourse.processing.org/t/problem-saving-serial-data-into-an-array/17003/4 "2020-01-11T15:40:18Z")

</div>

Hello,

See:

> [@Problem i face in serial communication](https://discourse.processing.org/t/problem-i-face-in-serial-communication/17023/2):
>
> Hello, You receive a string which includes a newline character ( ‘\n’ ) You need to remove the newline character ( ‘\n’ ) that is in the received string before splitting it so you can convert to an int. Example: [https://processing.org/reference/trim\_.html](https://processing.org/reference/trim_.html)[https://processing.org/reference/String.html](https://processing.org/reference/String.html) (discusses newline character and escape sequences such as \n) slight_smile String s1 = "123,456,890\n"; String [] list1 = split(s1, ','); printArray(list1); println(int(list1[2])…

🙂

---

_[View the full topic](https://discourse.processing.org/t/problem-saving-serial-data-into-an-array/17003)._
