# SplitTokens strings do not print as text

**URL:** <https://discourse.processing.org/t/splittokens-strings-do-not-print-as-text/20149>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [April 25, 2020, 9:32pm UTC](https://discourse.processing.org/t/splittokens-strings-do-not-print-as-text/20149 "2020-04-25T21:32:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laptophead](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/laptophead/32/2701_2.png) [@laptophead](https://discourse.processing.org/u/laptophead)\
**Post date:** [April 25, 2020, 9:32pm UTC](https://discourse.processing.org/t/splittokens-strings-do-not-print-as-text/20149/1 "2020-04-25T21:32:51Z")

</div>

I am receiving 3 different strings and I print them separately based on the first char.

All is well till I tried to parse one of strings by token. The newly formed strings will print out but will not show as text . I get a null pointer.

Please help.

```auto
  if (BTPort.available() > 0) {
    IncomingStr = BTPort.readStringUntil(lf);
    if (IncomingStr != null) {
      First = IncomingStr.charAt(0);
     // println(IncomingStr);
     // println(First);
      
  if (First == 'M')  
   Incoming_Currents_A = IncomingStr; // incoming current string from teensy
   
   else if (First == 'E')  
   {//Incoming_Encs_A= splitTokens(IncomingStr, "B "); // incoming current string from teensy
  
   Incoming_Encs = splitTokens(IncomingStr, "B");
   //println (Incoming_Encs[0]); 
   
   }
   
   else 
   Incoming_Info= IncomingStr; // incoming current string from teensy
    }
  }
  
  fill(g);  
  

    text (Incoming_Encs[0], 10, 1000); 
  text (Incoming_Encs[1], 400, 1000);
 
  text (Incoming_Currents_A, 10, 1040); 
  text (Incoming_Info , 10, 1080);
   
  

```

> please format code with \</\> button \* [homework policy](https://discourse.processing.org/faq/#homework) \* [asking questions](https://discourse.processing.org/t/2147)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 10, 2020, 1:30am UTC](https://discourse.processing.org/t/splittokens-strings-do-not-print-as-text/20149/2 "2020-05-10T01:30:03Z")

</div>

@laptophead – were you able to resolve this?

> [@laptophead](#):
>
> The newly formed strings will print out but will not show as text . I get a null pointer.

It is hard to test this or give feedback with only a code fragment.
