|
Amfitrion Wanderer
Joined: 29 Sep 2001 Posts: 75 Location: Israel
|
Posted: Thu Jan 24, 2002 10:40 pm
Count words |
Suppose I have a string I captured from the mud.
How do I count the ammount of words in this string?
- Amfitrion. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 24, 2002 10:44 pm |
%numwords(string)
Kjata |
|
|
|
Amfitrion Wanderer
Joined: 29 Sep 2001 Posts: 75 Location: Israel
|
Posted: Fri Jan 25, 2002 12:31 am |
On this occasion I must say it is bugged.
It counts spaces, not words.
But thanks, it still will do it!
- Amfitrion. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jan 25, 2002 2:27 am |
quote:
On this occasion I must say it is bugged.
It counts spaces, not words.
But thanks, it still will do it!
- Amfitrion.
By default, %numwords() uses a single space to denote word boundaries. You can specify any character or string you desire to mark the boundaries.
%numwords("This-is-a-test","-") should give you a count of 4
%numwords("This--is--a--test","-") should give you a count of 7, if I added correctly
li'l shmoe of Dragon's Gate MUD |
|
|
|
|
|