本文整理汇总了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"));
}
示例2: Main
public static void Main(string[] args)
{
var builder = new StringBuilder();
builder.Append("soskmlkdgmlalakm|AAAZ|dopkfdpokaaaz");
builder.RemoveText("AAAZ");
Console.WriteLine(builder.ToString());
}
示例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));
}
示例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));
}
示例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"}));
}
示例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));
}
示例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);
}
示例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);
}
示例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"));
}
示例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);
}
示例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
}
示例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
}
示例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());
}
示例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);
}
示例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);
}