copyright 1999 - 2014 by heinz prelle - hannover  - lenbachstraße 42 - www.visual-basic5.de | impressum
'Beispiel: VB .Net - String mit einer bestimmten Anzahl eines Zeichens füllen
'
Option Strict On
Option Explicit On

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MessageBox.Show(FillString("a", 5), "Info")
    End Sub

    Private Function FillString(ByVal MyChar As String, ByVal Length As Integer) As String
        Try
            Dim Result As New String(CChar(MyChar), Length)
            Return Result
        Catch
            Return ""
        End Try
        Return ""
    End Function
End Class
Sourcecode Visual Basic