c# ArraySegment
class Program
{
public static void Main()
{
string[] arr = { "a","b","c","d"};
ArraySegment<string> arrSeg = new ArraySegment<string>(arr);
//arrSeg.Array[2] = "e";
arr[2] = "e";
for (int i = arrSeg.Offset; i < (arrSeg.Offset + arrSeg.Count); i++)
{
Console.WriteLine("{0}-{1}-{2}", i, arrSeg.Array[i], arrSeg.Count);
}
byte[] b = BitConverter.GetBytes('好');
Console.WriteLine(b.Length);
Console.ReadKey();
}
private static void AddText(FileStream fs, string value)
{
byte[] info = new UTF8Encoding(true).GetBytes(value);
fs.Write(info, 0, info.Length);
}
}
相關文章
- 【C#】Learn C# in X minutesC#
- [C#]C#中字串的操作C#字串
- [C#]C#時間日期操作C#
- C#C#
- C# 語言歷史版本特性(C# 1.0到C# 8.0彙總)C#
- C#語言歷史版本特性(C# 1.0到C# 8.0彙總)C#
- C# 9.0 正式釋出了(C# 9.0 on the record)C#
- C# ActivatorC#
- C# on DevCloudC#devCloud
- C# DbHeplerC#
- C# FirstOrDefaultC#
- C# 概念C#
- C#反射C#反射
- c# 方法C#
- C# dynamicC#
- C# is與asC#
- Thrift c#C#
- C# HexEditC#
- c# abstractC#
- C# BackgroudWorkerC#
- XMLOperator[C#]XMLC#
- c# listviewC#View
- C#字串C#字串
- 《Effective C#》C#
- C# ViewStateC#View
- C#方法C#
- C#教程C#
- C# 物件C#物件
- C#特性C#
- c# channelC#
- C# 打包C#
- 重學c#系列——c#執行原理(二)C#
- C#神器"BlockingCollection"類實現C#神仙操作C#BloCGC
- C#入門之C#特點及HelloWorld程式C#
- C#基礎系列--C#中委託與事件(三)C#事件
- C#基礎系列--C#中委託與事件(一)C#事件
- 【C#開發】C#的協變和逆變C#
- C#閉包C#