本文整理匯總了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.