wc

Syntax

wc(X)

Details

Count the words in X.

Parameters

X is a string scalar/vector.

Returns

A scalar or vector of the INT type.

Examples

wc(`apple);
// output: 1

wc("This is a 7th generation iphone!");
// output: 6

wc("This is a 7th generation iphone!" "I wonder what the 8th generation looks like");
// output: [6,8]