I would write a function that returns how much of the string can "fit" on a line.
#define LCDWIDTH 84
static const uint8_t lengte[] = {
3, 1, 3, 5, 5, 5, 5, 2, 3, 3, 5, 5, 2, 5, 2, 5, //20,21,22,23,24,25,26,27,28,29,2a,2b,2c,2d,2e,2f
5, 3, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 4, 5, 4, 5, //30,31,32,33,34,35,36,37,38,39,3a,3b,3c,3d,3e,3f
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //40,41,42,43,44,45,46,47,48,49,4a,4b,4c,4d,4e,4f
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 5, 3, 5, 5, //50,51,52,53,54,55,56,57,58,59,5a,5b,5c,5d,5e,5f
3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 3, 4, 3, 4, 4, 4, //60,61,62,63,64,65,66,67,68,69,6a,6b,6c,6d,6e,6f
4, 4, 4, 4, 4, 4, 5, 5, 5, 3, 3, 3, 1, 3, 5, 5, //70,71,72,73,74,75,76,77,78,79,7a,7b,7c,7d,7e,7f
};
char* maxline(char* p, uint8_t max_width)
{
for (uint8_t w = lengte[*p - 0x20]; w < max_width; p++)
w += lengte[*p - 0x20];
return p;
}
void setup(void){
Serial.begin(9600);
}
void loop(void){
char* b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
char* e = maxline(b, LCDWIDTH);
Serial.write((const uint8_t *)b, e-b);
Serial.println("");
delay(10000);
}