且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#中的等效代码是什么?

更新时间:2023-02-07 19:57:39

等效的C#取决于您的缓冲区是什么.如果它已经是类似于string Buffer = "<bunch of characters>";的字符串,则无需执行任何操作.它已经是一个unicode字符串.如果是字节数组,请使用 System.Text.Encoding 中的一种编码器> [ ^ ]和呼叫 GetString(buffer) [ Convert() [
The equivalent C# depends a bit on what your buffer is. If it''s already a string like your string Buffer = "<bunch of characters>";, you don''t have to do anything. It is already a unicode string. If it''s a byte array, use one of the encoders in System.Text.Encoding[^] and call GetString(buffer)[^]. You can also call Convert()[^] first if you know the bytes are not in the encoding you need.

I''m not sure what you mean by "normal text". The string you show is as good as you are going to get due to the unprintable characters it contains.