strings icon indicating copy to clipboard operation
strings copied to clipboard

Limit string by number of words

Open omundy opened this issue 7 months ago • 2 comments

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(" ") + "...

omundy avatar Dec 07 '23 14:12 omundy