Click here to Skip to main content
16,016,345 members
Home / Discussions / C#
   

C#

 
QuestionIEnumIDList and C# problem Pin
soniko8-Mar-07 10:33
soniko8-Mar-07 10:33 
Questionhave a textbox go through every permutation Pin
crash8938-Mar-07 9:59
crash8938-Mar-07 9:59 
AnswerRe: have a textbox go through every permutation Pin
Ennis Ray Lynch, Jr.8-Mar-07 10:48
Ennis Ray Lynch, Jr.8-Mar-07 10:48 
AnswerRe: have a textbox go through every permutation Pin
CPallini8-Mar-07 10:56
mveCPallini8-Mar-07 10:56 
GeneralRe: have a textbox go through every permutation Pin
crash8939-Mar-07 17:54
crash8939-Mar-07 17:54 
GeneralRe: have a textbox go through every permutation Pin
CPallini13-Mar-07 9:07
mveCPallini13-Mar-07 9:07 
GeneralRe: have a textbox go through every permutation Pin
crash89313-Mar-07 13:21
crash89313-Mar-07 13:21 
GeneralRe: have a textbox go through every permutation Pin
CPallini15-Mar-07 11:41
mveCPallini15-Mar-07 11:41 
in fact, more difficult (at least to me) then I expected. But finally (with a bit use of recursion):
public static void Main(string[] args)
{
  perms("abc");
  Console.Read();
}
public static void perms(string s)
{
  for (int iDigits=1; iDigits<=s.Length;iDigits++)
  {
    recurse(s, "", iDigits, 0);
  }
}
public static void  recurse(string sOrig, string sCur, int iDigits, int iLevel)
{
  iLevel++;
  for (int i=0; i<sOrig.Length;i++)
  {
    string sNew =sCur+sOrig[i];
    if (iLevel == iDigits)
    {
      Console.WriteLine(sNew);
    }
    else
    {
      recurse(sOrig,sNew, iDigits, iLevel);
    }					
  }
  iLevel--;
}


Hope that helps.

P.S. I made a try with perms("abcde") and it runs (the correctness check is up to you...)Smile | :) Big Grin | :-D Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: have a textbox go through every permutation Pin
crash89315-Mar-07 16:49
crash89315-Mar-07 16:49 
GeneralSorry, was a misunderstanding between ME & HTML Pin
CPallini15-Mar-07 23:20
mveCPallini15-Mar-07 23:20 
GeneralRe: Sorry, was a misunderstanding between ME & HTML Pin
crash89318-Mar-07 6:55
crash89318-Mar-07 6:55 
QuestionDataViewGrid and dates Pin
crzyank8-Mar-07 9:51
crzyank8-Mar-07 9:51 
AnswerRe: DataViewGrid and dates Pin
Frank Kerrigan8-Mar-07 11:41
Frank Kerrigan8-Mar-07 11:41 
GeneralRe: DataViewGrid and dates Pin
crzyank9-Mar-07 2:10
crzyank9-Mar-07 2:10 
GeneralRe: DataViewGrid and dates Pin
crzyank9-Mar-07 2:15
crzyank9-Mar-07 2:15 
QuestionSettings Regional And Language Settings Programaticaly Pin
Aztekman8-Mar-07 9:16
Aztekman8-Mar-07 9:16 
AnswerRe: Settings Regional And Language Settings Programaticaly Pin
Frank Kerrigan8-Mar-07 11:49
Frank Kerrigan8-Mar-07 11:49 
QuestionRe: Settings Regional And Language Settings Programaticaly Pin
Aztekman9-Mar-07 3:56
Aztekman9-Mar-07 3:56 
QuestionIP to hostname Pin
marwan_siala8-Mar-07 8:00
marwan_siala8-Mar-07 8:00 
AnswerRe: IP to hostname Pin
pbraun8-Mar-07 8:31
pbraun8-Mar-07 8:31 
GeneralRe: IP to hostname Pin
marwan_siala8-Mar-07 22:58
marwan_siala8-Mar-07 22:58 
GeneralRe: IP to hostname Pin
\laddie8-Mar-07 23:28
\laddie8-Mar-07 23:28 
GeneralRe: IP to hostname Pin
marwan_siala8-Mar-07 23:35
marwan_siala8-Mar-07 23:35 
QuestionNull reference exception Pin
error14088-Mar-07 7:48
error14088-Mar-07 7:48 
AnswerRe: Null reference exception Pin
Edmundisme8-Mar-07 8:32
Edmundisme8-Mar-07 8:32 

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.