Joined July 2014
·

Josh

Topeka, KS
·
·

Posted to Meteor shorten string spacebar helper over 1 year ago

Thanks, this was helpful. I change it a bit to accommodate what I needed.
UI.registerHelper('shortIt', function(stringToShorten, maxCharsAmount){ if(stringToShorten.length <= maxCharsAmount){ return stringToShorten; } return stringToShorten.substring(0, maxCharsAmount); });
I did this so that the returned string is shortened only if it is longer than what was put in and if it isn't I only needed the whole string returned.

Thanks

Achievements
10 Karma
0 Total ProTip Views
Interests & Skills