AvalonStudio.TextEditor.Utils.CharRope.ToString C# (CSharp) 메소드

ToString() 공개 정적인 메소드

Retrieves the text for a portion of the rope. Runs in O(lg N + M), where M=length.
This method counts as a read access and may be called concurrently to other read accesses.
offset or length is outside the valid range.
public static ToString ( this rope, int startIndex, int length ) : string
rope this
startIndex int
length int
리턴 string
		public static string ToString(this Rope<char> rope, int startIndex, int length)
		{
			if (rope == null)
				throw new ArgumentNullException("rope");
#if DEBUG
			if (length < 0)
				throw new ArgumentOutOfRangeException("length", length, "Value must be >= 0");
#endif
			if (length == 0)
				return string.Empty;
			var buffer = new char[length];
			rope.CopyTo(startIndex, buffer, 0, length);
			return new string(buffer);
		}