public function testWordCount() { $this->eq(s::wordCount('these are words'), 3); $this->eq(s::wordCount(" \nsome\t\twords "), 2); $this->eq(s::wordCount(' '), 0); $this->eq(s::wordCount(''), 0); $this->eq(s::wordCount(" \n \n ", "\n"), 2); }
public function wordCount($chars = null) { return s::wordCount($this->value, self::unwrap($chars)); }