Possible Duplicate:
How to convert this C# code to Objective-C
This code purportedly does what I need in Objective-C but it's written in a different language. So I'm trying to convert this code to objective-c but I need to understand it better. It would be easier to understand if it was in pseudocode
static public IEnumerable<string> permute(string word)
{
if (word.Length > 1)
{
char character = word[0];
foreach (string subPermute in permute(word.Substring(1)))
{
for (int index = 0; index <= subPermute.Length; index++)
{
string pre = subPermute.Substring(0, index);
string post = subPermute.Substring(index);
if (post.Contains(character))
continue;
yield return pre + character + post;
}
}
}
else
{
yield return word;
}
}