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


C# StringBuilder.RemoveText方法代码示例

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


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

示例1: Main

 static void Main(string[] args)
 {
     StringBuilder test = new StringBuilder();
     test.Append("wqewe ewqewq qrqwe");
     Console.WriteLine(test.Substring(2, 5));
     Console.WriteLine(test.RemoveText("qrq"));
 }
开发者ID:DesislavaPetkova,项目名称:SoftwareUniversity,代码行数:7,代码来源:TestMain.cs

示例2: Main

    public static void Main(string[] args)
    {
        var builder = new StringBuilder();
        builder.Append("soskmlkdgmlalakm|AAAZ|dopkfdpokaaaz");
        builder.RemoveText("AAAZ");

        Console.WriteLine(builder.ToString());
    }
开发者ID:alex687,项目名称:SoftUni-Homeworks,代码行数:8,代码来源:Program.cs

示例3: Main

 public static void Main()
 {
     StringBuilder str = new StringBuilder();
     str.Append("Test extension methods for the class StringBuilder.");
     Console.WriteLine(str.Substring(5, 17));
     Console.WriteLine(str.RemoveText("methods"));
     IEnumerable<int> numbers = new List<int>() { 1, 2, 3, 4, 5 };
     Console.WriteLine(str.AppendAll<int>(numbers));
 }
开发者ID:GeorgiLambov,项目名称:SoftwareUniversity,代码行数:9,代码来源:StringBuilderExtension.cs

示例4: Main

        static void Main()
        {
            StringBuilder text = new StringBuilder("Example text.");
            IEnumerable<int> list = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

            Console.WriteLine(text.Substring(1, 3));
            Console.WriteLine(text.RemoveText("exa"));
            Console.WriteLine(text.AppendAll<int>(list));
        }
开发者ID:BAleksiev,项目名称:OOP-Course,代码行数:9,代码来源:Program.cs

示例5: Main

    static void Main()
    {
        var str = new StringBuilder("Functional Programming");
        Console.WriteLine(str.Substring(0, 11));

        str = new StringBuilder("Functional funcTional Programming");
        Console.WriteLine(str.RemoveText("Functional"));
        Console.WriteLine(str.AppendAll(new string[]{" ", "one", " ", "two"}));
    }
开发者ID:TzvetanIG,项目名称:OOP,代码行数:9,代码来源:TestStringBuilder.cs

示例6: Main

        public static void Main()
        {
            var extensionTest = new StringBuilder("Compelling data. Big ideas. Creative juice. Put Google research and insight behind your thinking.");
            var list = new List<string>() { "a", "b", "c", "d" };

            Console.WriteLine(extensionTest.GetSubstring(2, 10));
            extensionTest.RemoveText("Big ideas");
            Console.WriteLine(extensionTest);
            Console.WriteLine(extensionTest.AppendAll(list));
        }
开发者ID:EmilAleksandrov,项目名称:OOP,代码行数:10,代码来源:Test.cs

示例7: Main

 static void Main()
 {
     StringBuilder text = new StringBuilder("SoftUni");
     Console.WriteLine(text.Substring(4, 3));
     text.RemoveText("Uni");
     Console.WriteLine(text);
     List<int> integers = new List<int>() { 1, 2, 4, 5 };
     text.AppendAll(integers);
     Console.WriteLine(text);
 }
开发者ID:shnogeorgiev,项目名称:Software-University-Courses,代码行数:10,代码来源:SubstringExtensionsDemo.cs

示例8: Main

 static void Main()
 {
     StringBuilder str = new StringBuilder("georgi ivanov");
     IEnumerable<object> chars = new List<string>() { "georgiev", "ivanov" };
     Console.WriteLine(str.AppendAll(chars));
     string substring = str.Substring(4, 9);
     str.RemoveText("georgi ");
     Console.WriteLine(str);
     Console.WriteLine(substring);
 }
开发者ID:zhanivanov,项目名称:OOP_September_Homeworks,代码行数:10,代码来源:TestExtensions.cs

示例9: Main

        public static void Main()
        {
            var text = new StringBuilder("I'm the grates Cezar of all times!");
            Console.WriteLine("Original phraze: {0}\n", text);

            Console.WriteLine("(Substring) - Name: {0}", text.Substring(15, 5));
            var list = new List<string>() { " As ", "we ", "all ", "are!" };
            Console.WriteLine("(AppendAll) - Some new words: {0}", text.AppendAll(list));
            Console.WriteLine("(RemoveText) - Remove name: {0}", text.RemoveText("Cezar"));
        }
开发者ID:tormibg,项目名称:SoftUni-1,代码行数:10,代码来源:StringBuilderExtensionsTest.cs

示例10: Main

 static void Main(string[] args)
 {
     StringBuilder s = new StringBuilder();
     s.Append("kaji babe \"thank u.\"");
     Console.WriteLine(string.Format("Text: \n{0}",s));
     Console.WriteLine("Substring with parameters [1,6]: \n"+s.Substr(1, 6));
     Console.WriteLine("Remove text'babe':\n"+s.RemoveText("babe"));
     s.AppendAll(new List<string>{" Mai " , "uakahme ", "neshatata ", "Pesho!"});
     Console.WriteLine(s);
 }
开发者ID:yavor2000,项目名称:All-HomeWorks-SoftwareUniversity-TelerikAcademy,代码行数:10,代码来源:Program.cs

示例11: Main

        public static void Main()
        {
            StringBuilder sb = new StringBuilder("Implement some extension methods for the class StringBuilder:");
            IEnumerable<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6 };

            Console.WriteLine(sb.Substring(8, 16));
            Console.WriteLine(sb.RemoveText("ion method"));
            Console.WriteLine(sb.AppendAll<int>(numbers));

            // Console.WriteLine(sb.AppendAll<long>(numbers)); //// compile time error
        }
开发者ID:ScreeM92,项目名称:Software-University,代码行数:11,代码来源:StringBuilderTest.cs

示例12: Main

        public static void Main()
        {
            StringBuilder sb = new StringBuilder("Write something else else else else?????");
            IEnumerable<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6 };

            Console.WriteLine(sb.Substring(16, 24));
            Console.WriteLine(sb.RemoveText("ion method"));
            Console.WriteLine(sb.AppendAll<int>(numbers));
            
            // Console.WriteLine(sb.AppendAll<long>(numbers)); //// compile time error
        }
开发者ID:ScreeM92,项目名称:Software-University,代码行数:11,代码来源:StringBuilderTest.cs

示例13: Main

        static void Main(string[] args)
        {
            var sb = new StringBuilder();
            sb.Append("This is long long long text");
            Console.WriteLine(sb.Substring(5, sb.Length - 5));

            sb.RemoveText("long");
            Console.WriteLine(sb.ToString());

            sb.AppendAll(Enumerable.Range(0, 5));
            Console.WriteLine(sb.ToString());
        }
开发者ID:nok32,项目名称:SoftUny-HW,代码行数:12,代码来源:Program.cs

示例14: Main

        public static void Main()
        {
            StringBuilder sb = new StringBuilder("asfsfdgd");
            Console.WriteLine(sb.Substring(5, 3));
            Console.WriteLine(sb.Substring(5, 5));

            sb.RemoveText("sf");
            Console.WriteLine(sb);

            List<int> numbers = new List<int>() { 1, 2, 3, 4, 5 };

            sb.AppendAll(numbers);
            Console.WriteLine(sb);
        }
开发者ID:hkostadinov,项目名称:SoftUni,代码行数:14,代码来源:StringBuilderExtensionsTest.cs

示例15: Main

        public static void Main()
        {
            StringBuilder mySb = new StringBuilder("Lorem ipsum loremlorem obenadi");

            Console.WriteLine(mySb.Substring(1, 10));
            mySb = mySb.RemoveText("lorem");

            mySb = mySb.AppendAll(new List<string>()
            {
                "valeri", "asen"
            });

            Console.WriteLine(mySb);
        }
开发者ID:Vallerious,项目名称:OOP-Homeworks,代码行数:14,代码来源:TestStringBuilderExt.cs


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