StringTools[IsPermutation] - test whether a string is a permutation
|
Calling Sequence
|
|
IsPermutation( s )
|
|
Description
|
|
•
|
The IsPermutation(s) command returns the value true if the string s is a permutation of its support, and returns the value false otherwise. A string is a permutation if, and only if, each character in the string occurs exactly once.
|
•
|
Note that, since there are only distinct characters (byte values), the Pigeon-Hole Principle implies that no string permutation can exceed characters in length.
|
•
|
If s is the empty string, the command returns true.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
>
|
|
>
|
|
| (4) |
|
|
Download Help Document
Was this information helpful?