Ali*_*t0r 1 c# global function definition
我有两个函数,我似乎在软件中包括很多类型转换字符串和字节数组.用法是这样的:
string str = "Hello world";
byte[] b = strToByteArray(str);
Run Code Online (Sandbox Code Playgroud)
首先,有没有办法在System命名空间中包含它,所以我不必再在代码中定义它了?
其次,有没有办法将它定义为字符串类的一部分,因此用法更像是:
string str = "Hello world";
byte[] b = str.ToByteArray();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4419 次 |
| 最近记录: |