AvalonStudio.TextEditor.Utils.CharRope.IndexOf C# (CSharp) Method

IndexOf() public static method

Gets the index of the first occurrence of the search text.
public static IndexOf ( this rope, string searchText, int startIndex, int length, System.StringComparison comparisonType ) : int
rope this
searchText string
startIndex int
length int
comparisonType System.StringComparison
return int
		public static int IndexOf(this Rope<char> rope, string searchText, int startIndex, int length,
			StringComparison comparisonType)
		{
			if (rope == null)
				throw new ArgumentNullException("rope");
			if (searchText == null)
				throw new ArgumentNullException("searchText");
			rope.VerifyRange(startIndex, length);
			var pos = rope.ToString(startIndex, length).IndexOf(searchText, comparisonType);
			if (pos < 0)
				return -1;
			return pos + startIndex;
		}