本文整理汇总了C#中TextSpan.Overlap方法的典型用法代码示例。如果您正苦于以下问题:C# TextSpan.Overlap方法的具体用法?C# TextSpan.Overlap怎么用?C# TextSpan.Overlap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextSpan
的用法示例。
在下文中一共展示了TextSpan.Overlap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextSpanOverlap02
public void TextSpanOverlap02()
{
TextSpan span1 = new TextSpan(10, 10); // 10..20
TextSpan span2 = new TextSpan(5, 10); // 5..15
Assert.True(span1.OverlapsWith(span2));
Assert.True(span2.OverlapsWith(span1));
Assert.Equal(span1.Overlap(span2), new TextSpan(10, 5));
Assert.Equal(span2.Overlap(span1), new TextSpan(10, 5));
}
示例2: TextSpanOverlap04
public void TextSpanOverlap04()
{
TextSpan span1 = new TextSpan(10, 0); // [10, 10)
TextSpan span2 = new TextSpan(5, 10); // [5, 15)
Assert.False(span1.OverlapsWith(span2));
Assert.False(span2.OverlapsWith(span1));
Assert.Null(span1.Overlap(span2));
Assert.Null(span2.Overlap(span1));
}
示例3: TextSpanOverlap01
public void TextSpanOverlap01()
{
TextSpan span1 = new TextSpan(10, 10); // 10..20
TextSpan span2 = new TextSpan(5, 2); // 5..7
Assert.False(span1.OverlapsWith(span2));
Assert.False(span2.OverlapsWith(span1));
Assert.Null(span1.Overlap(span2));
Assert.Null(span2.Overlap(span1));
}