Is there a .NET library that can do string permutations or string expansion?

笑着哭i 提交于 2020-01-17 07:28:11

问题


What I'm looking for is some library or some code of classes that can be used to expand construction strings into variations and permutations. Something like the following (syntax is mine, may be different):

construction string: [Ff]oo [Bbß]ar|F(oo|oe)
output strings:
  Foo Bar
  foo Bar
  Foo bar
  foo bar
  Foo ßar
  foo ßar
  Foo
  Foe

While it wouldn't be too hard to build this myself, if it's around, why bother reinventing the wheel?


回答1:


This doesn't follows your syntax, but I use it in some projects and runs very smooth: Permutations, Combinations, and Variations using C# Generics



来源:https://stackoverflow.com/questions/2065824/is-there-a-net-library-that-can-do-string-permutations-or-string-expansion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!