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


C# StringSegment.ToString方法代码示例

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


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

示例1: StringSegment_CanBeCreatedFromString

        public void StringSegment_CanBeCreatedFromString()
        {
            var source = "Hello, world!";
            var segment = new StringSegment(source, 2, 4);

            TheResultingString(segment.ToString())
                .ShouldBe("llo,");
        }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:8,代码来源:StringSegmentTest.cs

示例2: Basic

 public void Basic()
 {
     StringSegment text = new StringSegment("basic");
     TextWikiRun run = new TextWikiRun(text);
     Assert.IsTrue(run.Text == text.ToString());
 }
开发者ID:ejball,项目名称:EdgeWiki,代码行数:6,代码来源:TextWikiRunTests.cs

示例3: RegisterLinkTarget

 /// <summary>
 /// Registers a link target with the command stream.
 /// </summary>
 /// <param name="target">The link target to register.</param>
 /// <returns>The index of the specified link target within the command stream's internal registry.</returns>
 public Int16 RegisterLinkTarget(StringSegment target) =>
     (resources = resources ?? new TextLayoutCommandStreamResources()).RegisterLinkTarget(target.ToString());
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:7,代码来源:TextLayoutCommandStream.cs

示例4: RegisterLinkTargetWithCommandStream

 /// <summary>
 /// Registers the specified link target with the command stream and returns its resulting index.
 /// </summary>
 private Int16 RegisterLinkTargetWithCommandStream(TextLayoutCommandStream output, StringSegment target)
 {
     return output.RegisterLinkTarget(target.ToString());
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:7,代码来源:TextLayoutEngine.cs

示例5: Segmented

 public void Segmented(string content, int start, int end, string expectedSegment)
 {
     var segment = new StringSegment(content, start, end);
     Assert.Equal(end, segment.EndIndex);
     Assert.False(segment.IsEmpty);
     Assert.False(segment.IsNull);
     Assert.Equal(expectedSegment.Length, segment.Length);
     Assert.Equal(TestContent, segment.Source);
     Assert.Equal(start, segment.StartIndex);
     Assert.Equal(expectedSegment, segment.ToString());
 }
开发者ID:DM-TOR,项目名称:nhin-d,代码行数:11,代码来源:StringSegmentFacts.cs

示例6: TestToString

 public void TestToString(string content, int startIndex, int endIndex, string expected)
 {
     var segment = new StringSegment(content, startIndex, endIndex);
     Assert.Equal(expected, segment.ToString());
 }
开发者ID:DM-TOR,项目名称:nhin-d,代码行数:5,代码来源:StringSegmentFacts.cs

示例7: DecodeBody

        static StringSegment DecodeBody(Message message)
        {
            StringSegment innerMessageText = message.Body.SourceText;
            TransferEncoding encoding = message.GetTransferEncoding();
            switch (encoding)
            {
                default:
                    throw new MimeException(MimeError.TransferEncodingNotSupported);

                case TransferEncoding.SevenBit:
                    break; // Nothing to do

                case TransferEncoding.QuotedPrintable:
                    string decodedText = QuotedPrintableDecoder.Decode(innerMessageText);
                    innerMessageText = new StringSegment(decodedText);
                    break;
                
                case TransferEncoding.Base64:
                    byte[] bytes = Convert.FromBase64String(innerMessageText.ToString());
                    string textFromBytes = Encoding.ASCII.GetString(bytes);
                    innerMessageText = new StringSegment(textFromBytes);
                    break;                    
            }
            
            return innerMessageText;
        }
开发者ID:DM-TOR,项目名称:nhin-d,代码行数:26,代码来源:WrappedMessage.cs


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