strings
strings copied to clipboard
Limit string by number of words
Is there a way to limit a string by the number of words? I tried a few ways to get at it.
Str("To be or not to be").words().limit(3).get()
I'm doing it right now with:
Str(text).words().slice(0,5).join(" ") + "...