ExtensionMethod.NET Home of 818 C#, Visual Basic, F# and Javascript extension methods

TabStop

Place a tab stop into a string

Source

''' <summary>
''' Adds/insert a TAB stop to this string
''' </summary>
''' <param name="sender"></param>
''' <returns></returns>
''' <remarks></remarks>
<Runtime.CompilerServices.Extension()> _
Function TabStop(ByVal sender As String) As String
    Return sender & System.Text.RegularExpressions.Regex.Unescape("\t")
End Function

Example

Private Sub Demo()
    Dim Sample As String = ""

    For x As Integer = 100 To 200 Step 10
        Sample &= x.ToString.TabStop
    Next
    Console.WriteLine("[{0}]", Sample)
    Sample = ""
    For x As Integer = 200 To 300 Step 10
        Sample &= x.ToString.TabStop
    Next
    Console.WriteLine("[{0}]", Sample)
End Sub

Author: Kevin S Gallagher

Submitted on: 26 okt 2009

Language: VB

Type: System.String

Views: 5820