gpt4 book ai didi

c# - 给 Python 程序员写 C# 的建议

转载 作者:太空宇宙 更新时间:2023-11-03 11:35:40 25 4
gpt4 key购买 nike

我看过这个question关于对编写 Python 代码的 C# 程序员的建议,但我的方向相反。

对于编写 C# 代码的 Python 程序员,有哪些提示、技巧和注意事项?

最佳答案

以下是我的问题所指的一些示例:

  • enumerate() in C#

    另一种可能性:

    "abc".Where((x,i) => true).Select((x, i) => string.Format("{0}: {1}", i, x))

    0: a
    1: b
    2: c
  • list comprehension in C#

    List<Foo> fooList = new List<Foo>();
    IEnumerable<Foo> extract = from foo in fooList where foo.Bar > 10 select Foo.Name.ToUpper();

关于c# - 给 Python 程序员写 C# 的建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4104885/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com