Hi!
How can I use ‘startsWith’ in a subscribe handler? I would like to check if the data that is subscribed to starts with a certain string.
Here is my code example:
char userPin[] = "1234";
void setup() {
Particle.subscribe("verification", verificationHandler);
}
void loop() {
}
void verificationHandler(const char *event, const char *data) {
if (data.startsWith(userPin)) {
// do something
}
}