Hey guys -- Anyone have a good snippet to limit the output to X lines or Y characters? IE: Anything that exceeds X character/words/lines is cut off.
The purpose is to limit scripts in a chat channel from outputting too much data,.. ie: Using say Wolframalpha some searches are quite short in their resulting output,.. but some searches (not intended to spam) can output 25 lines or more of text spamming the channel.
Any code to paste in the scripts I need to limit the output would be appreciated -- or even just a link to a snippet/code already on here that has the code in it to limit output so I can dig it out myself would be fine.
Appreciate any help.
Jonesy44 made this awhile back. It looks to be what you're wanting. It truncates a string to certain length, preventing overflow.
http://www.hawkee.com/snippet/5579/