var S:String; P:PChar; B:array of Byte;begin S:='Hello'; SetLength(B,Length(S)+1); P:=PChar(S); CopyMemory(B,P,Length(S)+1); ShowMessage(Char(B[0]));end; Length(S)+1 可以拷贝字符串最后的 #0 var str:string; B:array of byte; begin str:='string'; setlengt…
转载:https://blog.csdn.net/luanpeng825485697/article/details/78165788 我测试了下压缩byte[],是可以的 using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.IO.Compression; using UnityEngine; public class TestByteAtt…
function GetGUID: string; var vGUID: TGUID; vTemp:string; begin if S_OK = CreateGuid(vGUID) then begin vTemp := GUIDToString(vGUID); //去掉字符串中的{,-字符 vTemp:=StringReplace(vTemp,'-','',[rfReplaceAll]); vTemp:=StringReplace(vTemp,…
1.输入班级人数,统计每个人的姓名,性别,年龄:集合与数组 //Console.Write("请输入班级人数:"); //int a = int.Parse(Console.ReadLine()); //ArrayList al = new ArrayList(); //for (int i = 0; i < a;i++ ) //{ // string [] name =new string[3]; // Console.Write("请输入第{0}个人的姓名:&quo…