我需要删除转换为字符串的byte[]的前4个句子。
到目前为止,我所拥有的:
//convert bytearray to string, so I can modify the string
string rawString = Convert.ToBase64String(rawByteArray);
//seperate lines
string[] textLines = Regex.Split(rawString, "\r\n");
//I need to substract the first 4 senctences of the string here!
//convert string back to byte array
byte[] cleanByteArray = rawstring.FromBase64String(rawString);我如何减去前4句话?
提前感谢!
发布于 2013-06-06 19:45:39
你要找的不是Base64字符串,而是Encoding.GetString。
var newstr = String.Join(Environment.NewLine, Encoding.UTF8.GetString(buf)
.Split(new char[] { '\n', '\r' })
.Skip(4));
buf = Encoding.UTF8.GetBytes(newstr);https://stackoverflow.com/questions/16961234
复制相似问题