Invisionsoft
Well-known member
Hello Folks,
I've been trying to improve the efficiency of my giant program and I'm thankful for the help I have received here so far! I know that using a textbox to deal with a string is terribly inefficient and that's why I would be very glad if someone could provide a more efficient version of this short 8 line function.
What it does is convert a string of "1,2,3" into a collection of the 3 seperate items for use later on.
Thank you.
I've been trying to improve the efficiency of my giant program and I'm thankful for the help I have received here so far! I know that using a textbox to deal with a string is terribly inefficient and that's why I would be very glad if someone could provide a more efficient version of this short 8 line function.
VB.NET:
Function CollectionSplit(ByVal TheString As String, ByVal TheSeperator As String)
Dim tb As New TextBox
tb.Text = TheString.Replace(TheSeperator, Environment.NewLine)
Dim returnable As New Collection
For Each x As String In tb.Lines
If Not x.Length = 0 Then returnable.Add(x)
Next
Return returnable
End Function
What it does is convert a string of "1,2,3" into a collection of the 3 seperate items for use later on.
Thank you.