Click here to Skip to main content
15,888,205 members
Home / Discussions / C#
   

C#

 
AnswerRe: Open Excel Project Pin
sean_mufc5-Oct-05 7:22
sean_mufc5-Oct-05 7:22 
QuestionFile Copy Agent Printer Pin
Member 24613494-Oct-05 16:33
Member 24613494-Oct-05 16:33 
AnswerRe: File Copy Agent Printer Pin
Matthew134569844-Oct-05 17:30
sussMatthew134569844-Oct-05 17:30 
QuestionButton with a drop-down arrow Pin
David Wengier4-Oct-05 14:30
David Wengier4-Oct-05 14:30 
AnswerRe: Button with a drop-down arrow Pin
ehuysamer4-Oct-05 22:46
ehuysamer4-Oct-05 22:46 
AnswerRe: Button with a drop-down arrow Pin
Andy Moore5-Oct-05 6:48
Andy Moore5-Oct-05 6:48 
QuestionGenerate subsets from a string Pin
JoaoPe4-Oct-05 12:44
JoaoPe4-Oct-05 12:44 
AnswerRe: Generate subsets from a string Pin
Robert Rohde4-Oct-05 19:37
Robert Rohde4-Oct-05 19:37 
This method should do the job:
private void SearchCombinations(string[] splitted, int currentIndex, string resultSoFar, ArrayList results) 
{
   if (currentIndex >= splitted.Length)
      return;

   string nextResult = resultSoFar + splitted[currentIndex];
   results.Add(nextResult);
   SearchCombinations(splitted, currentIndex + 1, nextResult, results);
   SearchCombinations(splitted, currentIndex + 1, resultSoFar, results);
}


where the initial call should be something like:
ArrayList results = new ArrayList();
SearchCombinations("A B C D".Split(' '), 0, "", results);


and to make output at the end:
string output = "Combination Count:" + results.Count;
foreach (string s in results) 
   output  += "\n" + s;


Note that this is very memory hungry because all results are stored in memory, but for 26 characters (I tried it with the whole alphabet) it should work (although taking some time because of paging).
Questionhow handle objects and code of setup forms? Pin
Sasuko4-Oct-05 12:43
Sasuko4-Oct-05 12:43 
Questionhow to display script message? Pin
kani984-Oct-05 11:26
kani984-Oct-05 11:26 
AnswerRe: how to display script message? Pin
enjoycrack5-Oct-05 14:43
enjoycrack5-Oct-05 14:43 
GeneralRe: how to display script message? Pin
kani986-Oct-05 7:49
kani986-Oct-05 7:49 
GeneralRe: how to display script message? Pin
enjoycrack6-Oct-05 10:48
enjoycrack6-Oct-05 10:48 
GeneralRe: how to display script message? Pin
kani986-Oct-05 10:56
kani986-Oct-05 10:56 
GeneralRe: how to display script message? Pin
enjoycrack6-Oct-05 15:03
enjoycrack6-Oct-05 15:03 
Questionloop Problem with method Pin
james3774-Oct-05 11:01
james3774-Oct-05 11:01 
AnswerRe: loop Problem with method Pin
Heath Stewart4-Oct-05 11:23
protectorHeath Stewart4-Oct-05 11:23 
Questionantivirus and antivirus API Pin
Mridang Agarwalla4-Oct-05 10:02
Mridang Agarwalla4-Oct-05 10:02 
AnswerRe: antivirus and antivirus API Pin
Dan Neely4-Oct-05 10:26
Dan Neely4-Oct-05 10:26 
Questionexecuting a dos command Pin
Mridang Agarwalla4-Oct-05 9:56
Mridang Agarwalla4-Oct-05 9:56 
AnswerRe: executing a dos command Pin
Heath Stewart4-Oct-05 11:00
protectorHeath Stewart4-Oct-05 11:00 
Questionusing remote SMTP Pin
evgenyus4-Oct-05 9:16
evgenyus4-Oct-05 9:16 
AnswerRe: using remote SMTP Pin
Heath Stewart4-Oct-05 11:19
protectorHeath Stewart4-Oct-05 11:19 
QuestionExtended ASCII Pin
mcyrrer4-Oct-05 9:13
mcyrrer4-Oct-05 9:13 
AnswerRe: Extended ASCII Pin
mav.northwind4-Oct-05 10:55
mav.northwind4-Oct-05 10:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.