I need to take/cut first 300 words or characters from a string.
That means, I need a limited number of characters from a string, from the beginning.
Something like truncating.
Is there a function to do this?
str = "many words here words words words ..." first_500_words = str.split(" ").first(500).join(" ") first_500_chars = str[0..500]