I want to build a list containing every possible permutation of capitalization of a word. so it would be
List<string> permutate(string word)
{
List<string> ret = new List<string>();
MAGIC HAPPENS HERE
return ret;
}
So say I put in "happy"
I should get an array back of
{happy, Happy, hAppy, HAppy, haPpy, HaPpy ... haPPY, HaPPY, hAPPY, HAPPY}
I know of plenty of functions that will capitalize the first letter but how do I do any arbitrary letter in the word?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…