getting the first 25 words of a paragraph
Moderator: General Moderators
-
psychotomus
- Forum Contributor
- Posts: 487
- Joined: Fri Jul 11, 2003 1:59 am
getting the first 25 words of a paragraph
how can I get the first 25 words of a paragraph? I know i could use explod(string, " ") then run a for loop to combine the first 25, but theres probally a much simplier way.
The str-word-count could be of help
.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
or maybe a regular expression?
Code: Select all
^(\w+[\.,-?/{[}\]<>=_`~]?\w*\s){1,25}- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
You could also look at the example in the manual user notes. You know, the one that counts the number of words in a string up a certain number and puts elipse's after the max if there is more...