本文整理汇总了VB.NET中System.Text.StringBuilder.Remove方法的典型用法代码示例。如果您正苦于以下问题:VB.NET StringBuilder.Remove方法的具体用法?VB.NET StringBuilder.Remove怎么用?VB.NET StringBuilder.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Sample
' 导入命名空间
Imports System.Text
Class Sample
Public Shared Sub Main()
Dim rule1 As String = "0----+----1----+----2----+----3----+----4---"
Dim rule2 As String = "01234567890123456789012345678901234567890123"
Dim str As String = "The quick brown fox jumps over the lazy dog."
Dim sb As New StringBuilder(str)
Console.WriteLine()
Console.WriteLine("StringBuilder.Remove method")
Console.WriteLine()
Console.WriteLine("Original value:")
Console.WriteLine(rule1)
Console.WriteLine(rule2)
Console.WriteLine("{0}", sb.ToString())
Console.WriteLine()
sb.Remove(10, 6) ' Remove "brown "
Console.WriteLine("New value:")
Console.WriteLine(rule1)
Console.WriteLine(rule2)
Console.WriteLine("{0}", sb.ToString())
End Sub
End Class
输出:
StringBuilder.Remove method Original value: 0----+----1----+----2----+----3----+----4--- 01234567890123456789012345678901234567890123 The quick brown fox jumps over the lazy dog. New value: 0----+----1----+----2----+----3----+----4--- 01234567890123456789012345678901234567890123 The quick fox jumps over the lazy dog.