I have a string that is coming from a database that I want to break down into seperate parts, in order to view it on the screen, I've decided that they should be no larger than 55 characters. The max length of the initial string is 256 but could be as small as 10....
The string is dynamic.
So, If I have the string:
"This is a test string for my string manipulation help."
I would have this6 character max for this example):
string1: This i
string2: s a te
string3: st str
string4: ing fo
and so on .....
so far I have this, but I can't increment through the string..
The string is dynamic.
So, If I have the string:
"This is a test string for my string manipulation help."
I would have this6 character max for this example):
string1: This i
string2: s a te
string3: st str
string4: ing fo
and so on .....
so far I have this, but I can't increment through the string..
Code:
csHint1 = m_stClosureMethodData.szMethodHint; //assign csHint1 to string in Db.
nStringLen = strlen(csHint1);
nHintLines = (nStringLen / 55);
nHintLines = nHintLines++; //to determine how many sets of 55 characters that I have, and add 1 for remainder
strncpy(string, csHint1, 55);
while (nHintLines > 0)
{
//AfxMessageBox(csHint);
stHint.Add(string);
strncpy(string + 55, csHint1, 55);
nHintLines = nHintLines--;
}