Core Function CountWords
From Sputnik Wiki
(Difference between revisions)
UberFoX (Talk | contribs)
(Created page with "<pre> CountWords( <string> ) </pre> === Description === Return information about words used in a string . === Parameters === ==== char ==== An ASCII code in the range 0-255 ...")
Newer edit →
(Created page with "<pre> CountWords( <string> ) </pre> === Description === Return information about words used in a string . === Parameters === ==== char ==== An ASCII code in the range 0-255 ...")
Newer edit →
Revision as of 20:43, 26 July 2014
CountWords( <string> )
Contents |
Description
Return information about words used in a string .
Parameters
char
An ASCII code in the range 0-255 (e.g., 65 returns the capital letter A).
Return Value
Success: Returns a string containing the ASCII representation of the given code.
Failure: Returns a blank string.
Remarks
None
Example
// Display how many words are found my $Str = "The quick brown fox"; echo CountWords($Str), @NL; // Prints 4 // Return an array containing all the words found inside the string my $Str = "The quick brown fox"; printr CountWords($Str, 1); // Prints // ARRAY // { // [0] => The // [1] => quick // [2] => brown // [3] => fox // } // Return an associative array, where the key is the numeric position // of the word inside the string and the value is the actual word itself my $Str = "The quick brown fox"; printr CountWords($Str, 2); // Prints // ARRAY // { // [0] => The // [4] => quick // [10] => brown // [16] => fox // }