是否有可以进行字符串排列或字符串扩展的 .NET 库?

发布于 2024-08-17 20:20:31 字数 265 浏览 2 评论 0原文

我正在寻找的是一些库或一些类代码,可用于将构造字符串扩展为变体和排列。类似于以下内容(语法是我的,可能有所不同):

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

虽然自己构建这个并不太难,但如果它存在,为什么还要重新发明轮子呢?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巨坚强 2024-08-24 20:20:31

这不遵循您的语法,但我在一些项目中使用它并且运行非常流畅: 使用 C# 泛型的排列、组合和变体

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文