Questions tagged [toarray]

toarray, to convert from arraylist to array this method can be used. Being language specific for e.g. in Java its its available with ArrayList and in C# its used with List. Use this tag for toarray related questions.

toArray() Returns an array containing all of the elements in this list in the correct order.

Resource

147 questions
-1
votes
3 answers

Convert string (which is array) back to array

I've got a problem, if i retrieve a record from a database, it will return as a string. But I don't want that, because it should be an array: var_dump($data) returns string(654) "Array ( [0] => Array ( [1] => 17-6-2015 [2] => Livingwater TEST [3]…
Refilon
  • 3,334
  • 1
  • 27
  • 51
-1
votes
1 answer

Array out of bounds Euler 52

I've been trying to solve this problem on Euler. I want to convert an integer, to an array of strings. After this I want to convert each string to an array of characters, and this is where my code starts giving errors. namespace Problem_52_Euler { …
-1
votes
1 answer

how convert string to array MVC3 controller

how string [null,null,"3",null,null,null] convert to array? in MVC3 (controller)
lails
  • 105
  • 11
-2
votes
1 answer

Angular groupby and merge array

1 I am trying to merge duplicate value objects in an array but not working... I have my result like this but I want my data like this help me pls this is my code - dataa = [ { date: '07/05/2020 00:09', id:…
-2
votes
1 answer

java lang error when using toArray()

Here is my basic setup: ArrayList myList = new ArrayList<>(); myList.add("test"); String[] arr = myList.toArray(new String[myList.size()]); System.out.println(arr); And i get the classic error: [Ljava.lang.String;@1540e19d Can anyone…
-2
votes
1 answer

Difference between c.toArray(new String[size]) and c.toArray(new String[] {})

I can't seem to find an explanation for this. Does new String[] {} provide a more efficient way of providing the type of array?
halecommarachel
  • 124
  • 1
  • 9
-2
votes
1 answer

Merge Sorting Alphabetically, worked with predetermined names earlier but not with command line files

so I'm trying to write a program that sorts the contents of a file typed in from the command line alphabetically. I'm having troubles with reading in the file and then copying it from an arrayList "myArrayList" to an array "myList" to be printed in…
GEARZ
  • 77
  • 2
  • 2
  • 11
-3
votes
1 answer

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Class;

when I'm executing the below code I'm getting Class cast exception. I believe in an object is trying to cast with class can anyone help me public abstract AGridFilterMenu refreshFilters(); public AGridFilterMenu supportFilter(String style,…
Ram
  • 23
  • 1
  • 4
-3
votes
1 answer

When finding and using a single result in Iinq using ToArray() huge performance increase

I had some code for processing XML file that was running pretty slowly. The offending code is below. The first query should get either zero or one record from a set of about 1,000 records. If I get one, I then pull from another set (holding about…
patrickL
  • 23
  • 4
-4
votes
1 answer

Please help I can not see the error

I am using Intellj Idea and I am playing with ArrayLists, Arrays and a sorting algorithm I want to generate 5 random grades put them into an ArrayList convert the values of the ArrayList into an Array. Sort the Array values from least to greatest…
-4
votes
1 answer

Parse JSON with special characters into Array in PHP

{ "api_response": "{\"LeadRefNumber\":\"23223222433534543554\",\"ApplicationNumber\":\"2323343434234234\",\"StatusCode\":\"3456\",\"ProcessingStatus\":\"111\",\"CreditLimit\":\"5454554\",\"Messages\":{\"Message\":\"test.\"}}" } NOTE: The above…
-5
votes
2 answers

Convert IEnumerable to int[] without ToArray()

How can I convert IEnumerable to int[] without ToArray()? I need a method or function that will work faster than ToArray(). I have one big int massive state and two small massive left and right using method's Take and Skip. Code: int[] left =…
Question
  • 33
  • 4
1 2 3
9
10