I don't see how that's ever useful. If the string has less than 100 characters, it returns nothing. If the string has 100 or more characters, it returns either the same as the OP's solution or too many characters. (I'm assuming 100 is a maximum, such as a screen width or a field width.)
You've also used a different definition of "word" than everyone else such that cutting "don't" into "don" and "'t" is acceptable, and so is cutting "don't" into "don'" and "t".
In reply to Re^2: substr question
by ikegami
in thread substr question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |