Hello.
I'm getting information from the CLipboard that looks like the attached picture.
As you can see, there are 2 columns.
I'd like to be able to split each column into a separate array. This is what I have tried :
The problem with this is that I still get the entire row, instead of the first 5 characters of the row. I'd also like to know if it is possible to not include empty spaces - such as the first row??Code:Dim iData As IDataObject = New DataObject iData = Clipboard.GetDataObject() If iData.GetDataPresent(DataFormats.Text) Then strClipText = iData.GetData(DataFormats.Text, True).ToString().Split(Environment.NewLine.ToCharArray()) For iCounter = 0 To strClipText.Length - 1 strClipText(iCounter) = strLeft(strClipText(iCounter), 5) strClipText(iCounter) = Trim(strClipText(iCounter)) Next End If Public Function strLeft(ByVal param As String, ByVal length As Integer) As String 'we start at 0 since we want to get the characters starting from the 'left and with the specified lenght and assign it to a variable Dim result As String If IsNumeric(param) Then result = Trim(param.Substring(0, length)) 'return the result of the operation Return result End Function
Any help would be appreciated.




Reply With Quote