JavaScriptで文字列を切り詰める。prototype.jsを使って。

Ethnaの組み込みSmartyプラグインの "{...|truncate_i18n}"の様な処理をJavaScript側でできないかな。と、思っていたらprototype.jsのStringクラスの拡張でメソッドが用意されていた。

truncate([length = 30[, suffix = '...']]) -> string
Truncates a string to the given length and appends a suffix to it (indicating that it is only an excerpt).


http://www.prototypejs.org/api/string/truncate

なので、万事解決。
リファレンスよく読まないとだめ...。