-2

I want algorithm for all probability for uppercase for this word hgmsolgomd

I tried this code but this convert the word not letter by letter and not all probability

string name = "hgmsolgomd";
        for (int i = 0; i < name.Length; i++)
        {
            string newName = name.ToUpper();
        }
JJJ
  • 32,902
  • 20
  • 89
  • 102
Fast Work
  • 7
  • 5

2 Answers2

0

this is the correct answer Possible duplicate. The following post has the code for permutations of uppercase: stackoverflow.com/questions/905317/… -- this should cover your needs. – David Tansey 7 hours ago

Fast Work
  • 7
  • 5
-1

if even one capital letter includes to possibilities combination then:

  string text = "hgmsolgomd";

            int possibilitiesForAllCaps = (int)Math.Pow(2, text.Length) - 1;

There is "minus 1", because "hgmsolgomd" doesn't count, but say "hgmsolgomD" does.