当前位置: 首页>>代码示例>>C#>>正文


C# Rope.ToString方法代码示例

本文整理汇总了C#中Rope.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Rope.ToString方法的具体用法?C# Rope.ToString怎么用?C# Rope.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rope的用法示例。


在下文中一共展示了Rope.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppendLongTextToEmptyRope

 public void AppendLongTextToEmptyRope()
 {
     string text = BuildLongString(1000);
     Rope<char> rope = new Rope<char>();
     rope.AddText(text);
     Assert.AreEqual(text, rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:7,代码来源:RopeTests.cs

示例2: InitializeRopeFromLongString

		public void InitializeRopeFromLongString()
		{
			string text = BuildLongString(1000);
			Rope<char> rope = new Rope<char>(text);
			Assert.AreEqual(text.Length, rope.Length);
			Assert.AreEqual(text, rope.ToString());
			Assert.AreEqual(text.ToCharArray(), rope.ToArray());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:RopeTests.cs

示例3: ConcatenateSmallRopesToRope

 public void ConcatenateSmallRopesToRope()
 {
     StringBuilder b = new StringBuilder();
     Rope<char> rope = new Rope<char>();
     for (int i = 1; i <= 1000; i++) {
         b.Append(i.ToString());
         b.Append(' ');
         rope.AddRange(CharRope.Create(i.ToString() + " "));
     }
     Assert.AreEqual(b.ToString(), rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:11,代码来源:RopeTests.cs

示例4: ConcatenateStringToRope

		public void ConcatenateStringToRope()
		{
			StringBuilder b = new StringBuilder();
			Rope<char> rope = new Rope<char>();
			for (int i = 1; i <= 1000; i++) {
				b.Append(i.ToString());
				rope.AddText(i.ToString());
				b.Append(' ');
				rope.Add(' ');
			}
			Assert.AreEqual(b.ToString(), rope.ToString());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:12,代码来源:RopeTests.cs

示例5: ConcatenateSmallRopesToRopeBackwards

 public void ConcatenateSmallRopesToRopeBackwards()
 {
     StringBuilder b = new StringBuilder();
     Rope<char> rope = new Rope<char>();
     for (int i = 1; i <= 1000; i++) {
         b.Append(i.ToString());
         b.Append(' ');
     }
     for (int i = 1000; i >= 1; i--) {
         rope.InsertRange(0, CharRope.Create(i.ToString() + " "));
     }
     Assert.AreEqual(b.ToString(), rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:13,代码来源:RopeTests.cs

示例6: TestToArrayAndToStringWithParts

		public void TestToArrayAndToStringWithParts()
		{
			string text = BuildLongString(1000);
			Rope<char> rope = new Rope<char>(text);
			
			string textPart = text.Substring(1200, 600);
			char[] arrayPart = textPart.ToCharArray();
			Assert.AreEqual(textPart, rope.ToString(1200, 600));
			Assert.AreEqual(arrayPart, rope.ToArray(1200, 600));
			
			Rope<char> partialRope = rope.GetRange(1200, 600);
			Assert.AreEqual(textPart, partialRope.ToString());
			Assert.AreEqual(arrayPart, partialRope.ToArray());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:14,代码来源:RopeTests.cs

示例7: ConcatenateSmallRopesByInsertionInMiddle

 public void ConcatenateSmallRopesByInsertionInMiddle()
 {
     StringBuilder b = new StringBuilder();
     Rope<char> rope = new Rope<char>();
     for (int i = 1; i <= 1000; i++) {
         b.Append(i.ToString("d3"));
         b.Append(' ');
     }
     int middle = 0;
     for (int i = 1; i <= 500; i++) {
         rope.InsertRange(middle, CharRope.Create(i.ToString("d3") + " "));
         middle += 4;
         rope.InsertRange(middle, CharRope.Create((1001-i).ToString("d3") + " "));
     }
     Assert.AreEqual(b.ToString(), rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:16,代码来源:RopeTests.cs

示例8: InitializeRopeFromShortString

		public void InitializeRopeFromShortString()
		{
			Rope<char> rope = new Rope<char>("Hello, World");
			Assert.AreEqual(12, rope.Length);
			Assert.AreEqual("Hello, World", rope.ToString());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:6,代码来源:RopeTests.cs

示例9: EmptyRopeFromString

		public void EmptyRopeFromString()
		{
			Rope<char> empty = new Rope<char>(string.Empty);
			Assert.AreEqual(0, empty.Length);
			Assert.AreEqual("", empty.ToString());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:6,代码来源:RopeTests.cs

示例10: ConcatenateStringToRopeByInsertionInMiddle

		public void ConcatenateStringToRopeByInsertionInMiddle()
		{
			StringBuilder b = new StringBuilder();
			Rope<char> rope = new Rope<char>();
			for (int i = 1; i <= 998; i++) {
				b.Append(i.ToString("d3"));
				b.Append(' ');
			}
			int middle = 0;
			for (int i = 1; i <= 499; i++) {
				rope.InsertText(middle, i.ToString("d3"));
				middle += 3;
				rope.Insert(middle, ' ');
				middle++;
				rope.InsertText(middle, (999-i).ToString("d3"));
				rope.Insert(middle + 3, ' ');
			}
			Assert.AreEqual(b.ToString(), rope.ToString());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:19,代码来源:RopeTests.cs

示例11: ConcatenateStringToRopeBackwards

		public void ConcatenateStringToRopeBackwards()
		{
			StringBuilder b = new StringBuilder();
			Rope<char> rope = new Rope<char>();
			for (int i = 1; i <= 1000; i++) {
				b.Append(i.ToString());
				b.Append(' ');
			}
			for (int i = 1000; i >= 1; i--) {
				rope.Insert(0, ' ');
				rope.InsertText(0, i.ToString());
			}
			Assert.AreEqual(b.ToString(), rope.ToString());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:14,代码来源:RopeTests.cs


注:本文中的Rope.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。