August 2003
Intermediate to advanced
1104 pages
19h 27m
English
For the most part, the string functions create strings from other strings or report the properties of a string.
The count_chars function (Listing 12.1) analyzes a string by the characters present. The mode argument controls the return value as described in Table 12.1. See Figure 12.1.
| Mode | Description |
|---|---|
| 0 | Returns an array indexed by ASCII codes. Each element is set with the count for that character. |
| 1 | Returns an array indexed by ASCII codes. Only characters with positive counts appear in the array. |
| 2 | Returns an array indexed by ASCII codes. Only characters with zero counts appear in the array. |
| 3 | Returns a string containing ... |
Read now
Unlock full access