Questions tagged as 'array'

1
answer

Detect if I change the value of a key in the next round of the foreach?

I need to find out if the value of a key changes on the next round Ex: if($manzanas[$key]['cantidad'] == $manzanas[$key + 1]['cantidad']){ echo 'La cantidad de manzanas es la misma'; } else { echo 'La cantidad de manzanas cambio'; }...
asked by 12.01.2018 / 17:58
2
answers

Javascript arrays and calculations [closed]

I'm trying to create a array of Strings and give a value to each of the elements. Then calculate the length of each String and multiply each one by the previous multiplication. But it does not work. <h2> DEMO </h2...
asked by 08.06.2018 / 19:34
2
answers

Remove word from char array that starts and ends with 'a' in java

I have the following string String cadena="la amiga es mia"; I pass it to an array of chars: char[]caracteres=cadena.toCharArray Now what I want to do is from that array get the words that start and end with 'a' in this case you have t...
asked by 01.03.2018 / 13:35
1
answer

Why does it mark me error String index out of range: -1?

String Nombre="armando"; for (int i = 6; i <Nombre.length(); i--) { for (int j = 0; j < Nombre.length(); j++) { char n =Nombre.charAt(i);//Se supone que en esta linea esta el error char matriz[][] = new cha...
asked by 26.10.2018 / 23:25
3
answers

Fill array by keyboard within a [closed] range

I can not demand an entry range when filling an array, I show you: public static void llenar(int []sueldos, String [] nombres){ for(int i = 0; i<nombres.length; i++){ imprimir("Ingrese el nombre del empleado nu...
asked by 29.10.2017 / 17:01
2
answers

Create a JSON Object or a JSON Array?

It turns out that I have three tables, tablaA , tablaB , tablaC and I want to generate a JSON with it to be able to send it to another different base, but I want to separate the actions because in the tables there are insert a...
asked by 08.09.2018 / 08:06
2
answers

Show in cosola data of an array in Java [closed]

I want to extract and show in the console the data of a person in an array in Java that contains several repeated data like these: dni "Compound Name", "Surnames" and date. And that shows in a line the ID, in another line the name composed in ca...
asked by 15.10.2016 / 20:05
1
answer

why when I put a function as an array value, it returns function syntax and not its value?

var A = [ 'dog', 'cat', function () { return 2 * 2 } ] ; document.body.innerHTML = A[2] Return this: function () {return 2 * 2} Obviously I want you to return 4 , not the syntax of a function Or is it that you can not put a function in an...
asked by 02.01.2019 / 17:58
1
answer

Join 2 files in array of bytes in one [closed]

I have a method that receives as parameters 2 files in byte array format and its function is to join them in a single array. The problem is that when I try to open the resulting file the application tells me that the file is corrupt. The format...
asked by 24.04.2018 / 09:22
2
answers

Save in an Array [] file names of a folder in C #

How to save the file names in an array? When opening the Open File Dialog the path is obtained and in an array all the names of images or files are saved. Thank you.     
asked by 28.11.2018 / 23:27