美文网首页
C# 写转义封包

C# 写转义封包

作者: 孫志貴 | 来源:发表于2022-06-18 19:15 被阅读0次

Swift 原本的写法:

class test {
  static func someFunctionWithNonescapingClosure(closure: (String) -> Void) {
    let testString: String = "123"
    closure(testString)
  }

  static func usage() {
    someFunctionWithNonescapingClosure { newString in
      print(newString)

    }
  }
}

test.usage()

换 C# 之后:

using System;

class Untitled {
  static void someFunctionWithNonescapingClosure(Action<string> closure) {
    string testString = "123";
    closure(testString);
  }

  static void usage() {
    Action<string> testStr = Console.WriteLine;
    someFunctionWithNonescapingClosure(testStr);
  }
  static void Main(string[] args) { usage(); }
}

相关文章

  • C# 写转义封包

    Swift 原本的写法: 换 C# 之后:

  • c# entity framework中配置connection

    c# entity framework中配置connection string 在xml时,转义冒号"

  • C#转义符

    定义:由一个''+一个特殊字符,组成的一个特殊字符常用:\n --换行" --英文半角的双引号\t --tab键\...

  • C#中转义字符

    C#中转义字符分2中,一种是\,一种是@。 @符号在C#中有两个作用 作用1、在字符串的前面加@表示取消字符串中的...

  • 01-C#基础

    C#基础 l 变量命名规范: l 数据类型: @使字符串失去转义字符的作用 l 类型转换: "

  • 4.C#转义字符与数据类型转换

    1. 数据类型转换 C#中转义字符分2中,一种是\,一种是@。 @符号在C#中有两个作用 在字符串的前面加@表示取...

  • React(控制转义)

    在html标签中 在jsx中 转义效果都如下 想要不转义,可以这么写

  • 封包

    vxlan封包格式image.png 2.以太网封包格式 3.IP报文封包格式

  • 封包

    2022.9.19日星期一07:26分,晴朗,21-32℃ 太阳还是那么烈,我们掰着手指头,算烈日还有几天退场。 ...

  • 转义字符,算数,关系,逻辑运算符

    转义字符 转义字符的形式其实就是\* ,单个字符用''单引号,多个字符则用""双引号。想要几个*,就写几个转义字符...

网友评论

      本文标题:C# 写转义封包

      本文链接:https://www.haomeiwen.com/subject/arclvrtx.html