I'm stuck on a little bit of logic.
Imagine, if a string's length, l, exceeds some specified maximum length, m. How could you then remove the correct amount of characters from the center of the string (replace with ellipsis: ...) so that it is less than or equal to the maximum length.
m = 20
string = averylongstring over20chars
would become: averylongs...ve r20chars
I'm befuddled on this one.
Imagine, if a string's length, l, exceeds some specified maximum length, m. How could you then remove the correct amount of characters from the center of the string (replace with ellipsis: ...) so that it is less than or equal to the maximum length.
m = 20
string = averylongstring over20chars
would become: averylongs...ve r20chars
I'm befuddled on this one.
Comment