Number of Words in a String
- To: mathgroup at smc.vnet.net
- Subject: [mg102483] Number of Words in a String
- From: Gregory Lypny <gregory.lypny at videotron.ca>
- Date: Tue, 11 Aug 2009 04:02:50 -0400 (EDT)
Hello everyone, Is this the simplest way to find the number of words in a string? Seems a little complicated, and I can't seem to turn it into a function because when I replace the string with the argument placeholder myString_ I get an error message saying that a string is expected in that spot. Length[ReadList[StringToStream["The cat in the hat."], Word]] Returns 5. Gregory
- Follow-Ups:
- Re: Number of Words in a String
- From: Thomas Dowling <thomasgdowling@gmail.com>
- Re: Number of Words in a String
- From: Tomas Garza <tgarza10@msn.com>
- Re: Number of Words in a String
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Number of Words in a String
- From: Patrick Scheibe <pscheibe@trm.uni-leipzig.de>
- Re: Number of Words in a String
- From: jaebum@wolfram.com
- Re: Number of Words in a String
- From: "David Annetts" <davidannetts@aapt.net.au>
- Re: Number of Words in a String