what is this feature called in c# and which version of c# uses this

前端 未结 3 1452
感动是毒
感动是毒 2021-01-29 15:38

I am using this line of code in my project and haven`t seen this syntax.

 internal static StringBuilder a(this StringBuilder sb, string b) => sb.Append(b).Ap         


        
3条回答
  •  攒了一身酷
    2021-01-29 16:07

    If you mean the lambda arrow =>, it is a feature of C# 6 (expression-bodied function members). Check https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6#expression-bodied-function-members

提交回复
热议问题