Splitting incoming text into two labels

871 views
Skip to first unread message

yp

unread,
Nov 11, 2016, 6:01:44 PM11/11/16
to MIT App Inventor Forum
Hello, 

   I have hit a roadblock, and it is probably something really easy. But I was wondering if I could split incoming text into two labels. Label1 is the incoming bluetooth data. Example (temperature time) <- its a number then a space, then time. I want to split the incoming text where the temperature is in Label1 and after the space, time is in Label2.

Thank you.
Screen Shot 2016-11-11 at 4.56.26 PM.png

Taifun

unread,
Nov 11, 2016, 6:06:51 PM11/11/16
to MIT App Inventor Forum
use the split at spaces block to convert your string into a list

split at spaces

Divides the given text at any occurrence of a space, producing a list of the pieces.

then select the 1st and 2nd item

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

yp

unread,
Nov 11, 2016, 6:30:29 PM11/11/16
to MIT App Inventor Forum
How do I designate Label2 as the split portion of label1?

Diego Marino

unread,
Nov 11, 2016, 6:54:46 PM11/11/16
to MIT App Inventor Forum
Create two local variables, the set the label 1 to the first variable, label2 to the second variable
Reply all
Reply to author
Forward
0 new messages