UtilCombinatoricsCalculatePermutations(Int32, Int32, Boolean) Method
Calculates the amount of permutations that can be generated with the specified character set
and string length.
Namespace: DevCase.Core.Math.CombinatoricsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static long CalculatePermutations(
int charsetLength,
int stringLength,
bool allowRepetition
)
Public Shared Function CalculatePermutations (
charsetLength As Integer,
stringLength As Integer,
allowRepetition As Boolean
) As Long
Dim charsetLength As Integer
Dim stringLength As Integer
Dim allowRepetition As Boolean
Dim returnValue As Long
returnValue = UtilCombinatorics.CalculatePermutations(charsetLength,
stringLength, allowRepetition)
public:
static long long CalculatePermutations(
int charsetLength,
int stringLength,
bool allowRepetition
)
static member CalculatePermutations :
charsetLength : int *
stringLength : int *
allowRepetition : bool -> int64
No code example is currently available or this language may not be supported.
- charsetLength Int32
-
The length of the chararacter set. That is, the amount of elements in the set.
- stringLength Int32
-
The desired string length of each permutation.
- allowRepetition Boolean
-
A value indicating whether permutation repetition is allowed.
Int64
The resulting amount of permutations that can be generated.
This is a code example.
No code example is currently available or this language may not be supported.
Dim charSet As Char() = "1234".ToCharArray()
Dim charSetLength As Integer = charSet.Length
Dim stringLength As Integer = 2
Dim result As Long = CalculatePermutations(charSetLength, stringLength, allowRepetition:=True)
Console.WriteLine(result)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentOutOfRangeException
|
stringLength; The value of 'stringLength' must be smaller than 'charsetLength'.
|