0

I have a array with type of string and I'm trying to convert it to a new integer array by the code below

  intlist = list1.ConvertAll(New Converter(Of String, Integer)(AddressOf Integer.Parse))

But I always get this error, Visual Studio 2013 doesn't recognize the "ConvertAll".

 Error  1   Argument not specified for parameter 'converter' of 'Public Shared Function ConvertAll(Of TInput, TOutput)(array() As TInput, converter As System.Converter(Of TInput, TOutput)) As TOutput()'. C:\Users\Louis\Documents\Visual Studio 2013\Projects\DataGridCopyPaste\DataGridCopyPaste\Form1.vb   17  19  DataGridCopyPaste
4
  • I have tested this code and it works (even in VS 2010): Dim list1 As New List(Of String) From {"1", "2", "3"} Dim intlist As List(Of Int32) = list1.ConvertAll(New Converter(Of String, Integer)(AddressOf Integer.Parse)). I also don't understand "Visual Studio 2013 doesn't recognize the 'ConvertAll'" in combination with your error: "Argument not specified". It seems that it actually recognizes the method but doesn't like a parameter. Commented Jul 21, 2014 at 15:10
  • 1
    possible duplicate of How to convert an array from string to integer Commented Jul 21, 2014 at 15:43
  • 1
    Please do not repost your question, if someone's answer to a previous question doesn't work, address it to them in the comments of their answer. Commented Jul 21, 2014 at 15:59
  • what type is list1? Not an IList presumably. Commented Jul 22, 2014 at 8:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.