Skip to content

Instantly share code, notes, and snippets.

View farshid616's full-sized avatar

farshid616

View GitHub Profile
@farshid616
farshid616 / gist:760ac82a46254e2b2f0c06a5fc8b3ea0
Last active June 2, 2018 11:15 — forked from mattfelsen/gist:9467420
Splitting strings by a delimiter for Arduino
//
// This is tested and works!
//
String input = "123,456";
int firstVal, secondVal;
for (int i = 0; i < input.length(); i++) {
if (input.substring(i, i+1) == ",") {
firstVal = input.substring(0, i).toInt();
secondVal = input.substring(i+1).toInt();