I'm doing a project where text is coming in from adafruit.io and I would like to pull that text into a string, break it into parts, and repackage it for printing on a thermal printer. The reason for the repackaging is to be able to format different parts of the text (bold, italics, size, etc.). So my pseudo-code would be something like:
String msgString = data->value(); // Could be something like "Title:This is the body of the text."
Break up the string into title and body
String title = the title part of my message
String body = the main body of my message
printer.boldOn();
printer.println(F(title));
printer.boldOff();
printer.println(F(body));
So coming off the printer it would look like:
Title
This is the body of the text.
I can use any character to break up the text, but I don't understand how I can look through the string and separate the parts. Any help would be greatly appreciated!