Questions tagged as 'string'

1
answer

Java doubt with equals () and with ==

Until a few years ago if I did in Java    "Hello" == "Hello" gave me as a false result, today I saw a code in which they used it with JDK 10 and out of curiosity I went to check it, and it actually returns true, someone can explain why th...
asked by 08.09.2018 / 20:30
4
answers

How to format a string to 2 decimal places Java?

I explain: I have a String in Java : String numero = "59.2348837"; this is what I'm trying to do: String.format( "%.2f", numero) And I try to get as a result: String resultado = "59.23"; But it throws me an error becaus...
asked by 18.04.2018 / 00:14
5
answers

ListObject to String in Java

I have a List of an Object. public class BusStop { private String description; private float lat; private float lng; //getter and setter } Of which I try to put all its content inside a variable of type String. I tri...
asked by 10.05.2018 / 12:06
2
answers

javascript string.indexOf (array) does not work with long strings

I was looking for a good time but all the questions were different from mine. I'm trying to find a string in an array where the strings within the array contain more than one word, for example: var array = ["hola soy un string", " asd hola...
asked by 09.11.2016 / 10:50
4
answers

C #: How to identify the first digit of each number in a vector to count how many numbers start the same?

Good day. I have this problem, I guess it's simple but I have not been able to solve it and I have one day in that, I have a program that accepts 10 numbers and enters them in a vector, but I need to know how many of these 10 start with th...
asked by 20.03.2018 / 01:00
1
answer

Sort a List of Objects in Java

I have a list of my own Java objects, which need to be sorted by the property code of the object itself. List<Calle> listaDeCalles; Calle calle1 = new Calle(); calle1.setCodigo("A4"); ... listaDeCalles.add(calle1); l...
asked by 14.10.2016 / 13:24
1
answer

Know if a word is found in a string in php

I have the following code: $msg = 'Hola :1: quetal??, :2:'; $emoticones = array(':1:',':2:',':3:'); $cntidademoticon = explode(' ', $msg); foreach ($cntidademoticon as $string) { echo '<br>'.$string.'<br>'; } What I am looki...
asked by 19.08.2018 / 02:46
1
answer

Extract part of a chain between two specific points

Recently I found myself needing to extract all the values that are between two specified points of a chain, in this case everything that is inside the parentheses "()" . What would be the most optimal way to do this? string cadena =...
asked by 11.06.2018 / 16:59
2
answers

Concatenate a string with a C ++ float

I have a problem when concatenating a string type variable with a float, I have the following: float c1 = 0, c2 = 0, c3 = 0; std::string best = ""; Then I use it in the following way: best = "Imagen 1: " + c1; best = "Imagen 2: " + c2; be...
asked by 01.11.2016 / 21:40
3
answers

How can I separate a string from a string

I need to enter a date, that you enter as string example: 21/10 / 2016-12: 04, and these data convert each one into a data type, (int, byte), to make validations and then enter them to a calendar     
asked by 21.10.2016 / 07:07