Skip to content

Instantly share code, notes, and snippets.

@Laicure
Last active February 3, 2016 15:27
Show Gist options
  • Select an option

  • Save Laicure/f98f35c0ea6a5b5dcff2 to your computer and use it in GitHub Desktop.

Select an option

Save Laicure/f98f35c0ea6a5b5dcff2 to your computer and use it in GitHub Desktop.

Revisions

  1. Laicure revised this gist Feb 3, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion StringManipulate.vb
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ Module StringManipulate
    #End Region

    #Region "ListBox Items to Array String"
    Friend Function ListBoxToArray(ListBoxer As ListBox) As String()
    Friend Function ListBoxToArray(ListBoxer As ListBox) As String()
    Dim arr As String() = {"*"}
    If ListBoxer.Items.Count > 0 Then
    arr = New String(ListBoxer.Items.Count - 1) {}
  2. Laicure revised this gist Feb 3, 2016. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions StringManipulate.vb
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,18 @@ Module StringManipulate
    Return String.Join("", y.ToArray)
    End Function
    #End Region

    #Region "ListBox Items to Array String"
    Friend Function ListBoxToArray(ListBoxer As ListBox) As String()
    Dim arr As String() = {"*"}
    If ListBoxer.Items.Count > 0 Then
    arr = New String(ListBoxer.Items.Count - 1) {}
    For i As Integer = 0 To ListBoxer.Items.Count - 1
    arr(i) = ListBoxer.Items(i).ToString
    Next
    End If
    Return arr
    End Function
    #End Region

    End Module
  3. Laicure revised this gist Jan 26, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion StringManipulate.vb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Imports System.Text

    Module StringManipulatorsSnips
    Module StringManipulate
    #Region "Code Generator"
    Public Function CodeGen(sizer As Integer, customString As String) As String
    Dim charX As String = IIf(String.IsNullOrWhiteSpace(customString), "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz", customString).ToString
  4. Laicure created this gist Jan 25, 2016.
    29 changes: 29 additions & 0 deletions StringManipulate.vb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    Imports System.Text

    Module StringManipulatorsSnips
    #Region "Code Generator"
    Public Function CodeGen(sizer As Integer, customString As String) As String
    Dim charX As String = IIf(String.IsNullOrWhiteSpace(customString), "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz", customString).ToString
    Dim Rand As New Random
    Dim BuildMe As New StringBuilder
    Dim idx, CodeSize, charXsize As Integer
    charXsize = charX.Length
    CodeSize = sizer
    For i As Integer = 1 To CodeSize
    idx = Rand.Next(0, charXsize)
    BuildMe.Append(charX.Substring(idx, 1))
    Next
    Return BuildMe.ToString
    End Function
    #End Region

    #Region "Character Duplicate Remover"
    Public Function CharDupRemove(strx As String) As String
    Dim x() As Char = strx.ToCharArray
    Dim y As Generic.List(Of Char)
    y = x.Distinct.ToList

    Return String.Join("", y.ToArray)
    End Function
    #End Region
    End Module