Core Function CountWords

From Sputnik Wiki
Revision as of 20:43, 26 July 2014 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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
// }
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox