Questions tagged as 'array'

3
answers

Return last index of Array

I have the following code that will bring me an indeterminate list; for example 5 items. I would like to return only the last item in the list. for(var i = 0; i < data.list.length; i++){ if(Date.parse(data.list[i].date) >= dateA){...
asked by 27.03.2018 / 01:25
3
answers

How to remove the first item from an array without for or foreach

How to remove the first item from a non-foreach array. I have tried this, but it says that there is no remove or removeAt method. int[] arr = {1,2,3,4,5}; var removeu = Array.Remove(arr,0);//Agora percebi que isso é javascript, rs This...
asked by 06.07.2015 / 22:57
2
answers

Browse JSON - AngularJS

I have the following object: { "_id" : ObjectId("5a0ae1a032e3762988cddb11"), "numeroBo" : NumberInt(4), "relato" : "aaaa", "modus" : "bbb", "falhasApuradas" : "aaaa", "eventosDeRisco" : [ ], "acoesCriminosas" : [ ], "alertas" : [...
asked by 14.11.2017 / 13:44
1
answer

How to stop printing positions = 0 of a vector?

In the example below, how would I stop printing the positions of this vector that are equal to 0 int[] caluculo = {50,6,0,59,6,7,0,6,8}; for(int i = 0 ; i < 9 ; i++) { Console.WriteLine("{0}",calculo[i]); }     
asked by 24.02.2018 / 15:16
3
answers

Transform string into json

I'm having trouble converting string {data} to Json , I get it separated by commas several times, I would like to convert it to Json to collect the first key var data = [ "$SP", "92", "00:01:36.340", "00:05:48.929\n" ]; var...
asked by 31.10.2018 / 18:14
2
answers

How to find out if an array is multidimensional or not in PHP?

I have these two arrays below: $a = [1, 2, 3]; $b = [1,[2, [3, 4]]]; I know that $a is a% one-dimensional%, and array , multidimensional (arrays array). Now, how would I find out, through a function, that I returne...
asked by 12.08.2016 / 20:16
4
answers

Error checking the IF with array in PHP

I'm trying to make a if within a foreach and the situation is as follows: I have array that I called $ enrollments which returns like this: array(2) { [0]=> array(1) { ["chave"]=> string(1) "1" } [1]=> array(...
asked by 18.07.2016 / 23:58
3
answers

Append items to the beginning of a vector without affecting existing values

How do you include 3 numbers at the beginning of this vector without affecting the previous numbers? I'm trying to do this: int main() { int v[30]; int i,x; for(i=0; i < 15; i++) { printf("Digite 15 numeros");...
asked by 12.06.2018 / 03:29
3
answers

Error traversing vector

The user pastes the values that will be saved into the vector and then displays those values. However the following error is occurring:   An unhandled exception of type 'System.IndexOutOfRangeException' occurred in vetoor.exe ". My code l...
asked by 04.01.2017 / 22:01
2
answers

Assign JSON values to simple variables

I'm having trouble reading a JSON that I get: {"data":{"charges":{"data":{"charges":[{"code":10006756,"dueDate":"13/09/2014","link":"https://www.teste.com.br"}]},"success":true} I need to assign these values to my variables, this array will...
asked by 11.09.2014 / 04:38