Questions tagged as 'lista'

6
answers

How to remove 2 digits from each list item?

I have a list / array: var lista['01.um','02.dois','03.tres'] I need to create a new list like this: lista['01','02','03'] I know little about Groovy and Java, what is the correct way to create the list?     
asked by 19.06.2016 / 20:55
2
answers

How to store a Listobject in a database?

I'm working on a C # project where I have the following situation. I have a class that represents a player: class Player { int ID; string Name; } and one that represents a team: class Team { int ID, string Name; List<...
asked by 27.07.2016 / 18:31
3
answers

Repeated letter counter in java

I made a method for counting repeated letters that are stored and ordered alphabetically within a list. The method is counting right but the bug is at the time of printing, it printa the letter and the amount of times that appears in the sentenc...
asked by 18.09.2017 / 02:36
4
answers

Create list with more than one element as if it were multidimensional

I need to receive these pairs of data from the database, and I'm thinking of a way to bring the values without having to create an object, as I find it unnecessary in this case. Is it possible to create a list<string,string>...
asked by 13.08.2018 / 16:53
2
answers

What is Java's sort?

Every programmer knows that a list of arrays is printed neatly, but in the middle of the path has sort() . The result of this impression was: Abacaxi Banana Laranja Manga I imagined it would print this way: Banana Laranja...
asked by 14.10.2018 / 13:54
2
answers

Save multiple instances of a class to a List in Java

I'm having a college assignment that I need to create multiple instances of a Pessoa object and save those instances to a listing to show the user when needed (this will work as a database). As we have not seen database I still can not insert t...
asked by 18.04.2016 / 03:59
3
answers

Catching more items in a list array in Python

I have an array in Python made up of arrays. But these arrays can have different sizes. For example: matriz = [[1,2,3],[4,5,6,7],[1,2,3,4,5,6]] What I want to know is if there is a medium (some python-ready function) that returns the size o...
asked by 07.12.2016 / 14:51
2
answers

How do I convert an enum type to list?

Is there any way to convert a Enum to List ? public enum TiposHospedagem { Casa = 1, Hotel = 2, Pousada = 3, CasaCampo = 4 } I'm trying to get enum and add to the list, but foreach does not want to...
asked by 31.08.2016 / 17:13
2
answers

How to separate only the first word from each string in a list?

Given this list: nomes = [ " Paulo Ricardo " , " Fabio Junior " , " Roberto Carlos " ] How do I create a new list by separating the first and last name and only adding the first name without the last name in this new list, using list compre...
asked by 17.04.2018 / 22:25
2
answers

How to format all the elements of a list in Python?

In php, when I want to generate a array formatted, I use the array_map function. So: $numeros = range(1, 10); array_map(function ($value) { return sprintf('%04', $value); }, $numeros); Return: array('0001', '0002', '...
asked by 28.10.2015 / 19:43