字符组合的所有可能组合

时间:2022-10-29 21:24:04

I need to get every possible combination of characters that follows a rule.

我需要获得遵循规则的每个可能的字符组合。

Say:

说:

Length: 5-6
Characters: ABCabc123

长度:5-6个字符:ABCabc123

I should get stuff back like this:

我应该这样回来:

AAAAA
AAAAB
AAABA
AAABB
..
..
AcbC13

Is there any way to do this quick an efficiently?

有没有办法快速有效地做到这一点?

Please keep in mind I am using VB.net but I do understand concepts related to just general speaking.

请记住我使用的是VB.net,但我确实理解与一般说法相关的概念。

1 个解决方案

#1


2  

There is some good code to do exactly that here: http://www.codeproject.com/KB/recipes/Combinatorics.aspx

这里有一些很好的代码可以做到:http://www.codeproject.com/KB/recipes/Combinatorics.aspx

#1


2  

There is some good code to do exactly that here: http://www.codeproject.com/KB/recipes/Combinatorics.aspx

这里有一些很好的代码可以做到:http://www.codeproject.com/KB/recipes/Combinatorics.aspx