There is a spintax string.

{{Hello|Howdy|Hola}|{Hello|Howdy|Hola}} 

Interested in the question of how to find all possible combinations?

Found the code in the network, however, it only finds a random variation.

 public String SpinRE(String text) { while (true) { Match m = reg.Match(text); if (!m.Success) break; parts = m.Value.Substring(1, m.Value.Length - 2).Split('|'); text = text.Substring(0, m.Index) + parts[rand.Next(parts.Length)] + text.Substring(m.Index + m.Length); } return text; } 
  • Do you need a method that returns an array of all possible combinations of input text? those. for {{Hello | Howdy | Hola} | {Hello | Howdy | Hola}} these are: "Hello Hello", "Hello Howdy", "Hello Hola", "Howdy Hello", etc. Give an example (at least partial) of the output you want to receive as a result of executing the required method - Alexey

0