Questions tagged as 'array'

1
answer

ArrayList returning null values

I have an array, I add values in this array, I send them to a method in another class that puts the values of this array in a string only and I add this single string in an ArrayList, but when I go to show it, it shows only several nulls ". M...
asked by 20.04.2014 / 18:32
2
answers

How to insert space in CamelCase string?

I'm looking for a way to separate string from an array object, coming from an API, for example: PageViews, Page Views, I'm using VUEJS.     
asked by 23.10.2018 / 16:03
1
answer

How to fill an ArrayList with values from another ArrayList randomly picked?

I have class Vetor which will have a method to start a vector with random numbers: public class Vetor{ private int tamanho; private int[] vetor; public Vetor(int tamanho) { this.tamanho = tamanho; this.vetor =...
asked by 13.02.2017 / 15:34
1
answer

How to insert a statement in the array only if it is true?

I need to somehow check if there is any element within a given array and if it exists, put a string in a specific place. For example:    I need to check if $categoria is not empty $categoria = array($values);   ...
asked by 02.01.2016 / 18:29
2
answers

Grouping and adding array in JavaScript

How to make a function to only add values that are of the same date? I'm passing an array of arrays: [{ servicos: 0, remessa: 503, materiais: 0 , retorno: 598, entrada: 0, date: new Date("2011/12/20") }, { servicos: 302, remessa: 0, materiais:...
asked by 15.05.2014 / 16:20
1
answer

How to check if a field in an array of chars is empty in Java?

I'm trying to check if a certain position in an array of chars actually contains some character. I tried two ways: char[] arr = new char[10]; if(arr[0] == null){ } And also: char[] arr = new char[10]; if(arr[0] == ''){ } When typ...
asked by 28.07.2018 / 02:09
1
answer

How can I reorganize this array? [duplicate]

I have the following array: $array_atual = array ( 'id_item' => array('1', '3'), // 'id_item', 'id_item' 'cantidad' => array('15', '10') // 'cantidad', 'cantidad' ); I would like to leave it as follows: $array_final (...
asked by 10.06.2018 / 12:44
1
answer

Get size of a two-dimensional array

I have a two-dimensional array of char dynamically allocated, how do I get its size? I would use sizeof (client); For example, I instantiated a struct client, Customer ** customer; then in the code I'm allocating it as it goes (tamVetor ++...
asked by 01.07.2018 / 02:57
1
answer

Vector union

How do I join 2 vectors in 1 vector? Without repeating the numbers? Question: Make a program that reads two vectors of 10 elements. Create a vector that is the union between the 2 previous vectors, that is, that contains the numbers of the tw...
asked by 21.10.2017 / 21:31
1
answer

Compare values between Array's JavaScript

Good morning, My dear, I need an orientation on comparing values between two Array's in JavaScript. I am working on a small lottery simulator where the code starts with the first Array containing 6 numbers, the second Array will store the 6 numb...
asked by 27.12.2017 / 14:03