Questions tagged as 'string'

1
answer

I'm playing the hangman game, and do I need to change a string for a char? but only one in a position

public class replace { public static void main(String[] args) { Scanner teclado = new Scanner(System.in); String sentence = "SISAS"; String auxWord = sentence; int g = sentence.length()*2; String remplazo = "_ "; while(r...
asked by 22.07.2016 / 02:32
1
answer

java.lang.NumberFormatException using jsonObject.optString ()

Good, I have the following problem only on certain occasions. The app brings information from an external url by means of a Volley request taking the data from a php file with json data. Of 900 devices I had a problem in 17, it is little but the...
asked by 27.07.2018 / 15:08
1
answer

String a Date formatted correctly

I have a question, as far as dates are concerned in Java. I receive several dates in String format but each of them comes in a different format, so they do not come in a certain format. Dates with formats such as: 21/05 / 2018Z09: 14: 32....
asked by 21.05.2018 / 11:06
1
answer

How to know if a String contains any of the first 10 letters of the alphabet VB.Net

I have to do a program in vb.net to check if a string that is entered by keyboard contains any of the first 10 letters of the alphabet or not. I've tried this but it has not worked. Overloads Sub MostrarDatosCalculados(ByVal nombre...
asked by 02.10.2018 / 10:41
1
answer

Data entry via std :: getline does not wait for the user to enter the string

I try to make a program in C ++ to store, search and replace student data, but in the case 3 (to replace data) I have problems with data entry type string. Since in the part where the user must enter the data that will replace the old...
asked by 26.11.2017 / 04:17
4
answers

It does not compare well the string (I think). Java CompareTo ()

Well, I have a problem and I do not understand why it does not compare well the value of the string. I would appreciate all the help possible. By not sharing well the "numbers" (passed as string). the final string is larger than a long and gives...
asked by 24.11.2017 / 13:50
1
answer

When validating a tag, the string [duplicate] does not match

I have this code to write a xml but when validating the statement if does not take it into account. Does anyone know why? How to validate a xml: tag for(int i=0; i<nodeList.size(); i++){ if(nodeList.get(i).toSt...
asked by 08.06.2017 / 18:49
4
answers

Problem in scanning scan and storing text in C ++

This is the code of my program: #include stdio.h #include stdlib.h #include string.h int main () { string a; string help = "-h"; printf("Por favor introduzca la orden. Si desea ver la ayuda introduzca -h");...
asked by 10.06.2016 / 20:57
0
answers

Convert JSON ARRAY TO STRING

I have this method that is from a list of products public String ProductosFacturas() { float montoTotalf = 0; int productsize = ctPagar.getProductArraylistsize(onGo); //Crear Array de productos del carrito para pasarlos al serv...
asked by 24.08.2018 / 16:02
12
answers

How to correctly compare Strings (and objects) in Java?

I am creating a mini game in which the user tries to guess a name. But when I want to compare two text strings to see if they are equal it does not seem to work. final String miNombre = "Jordi"; Scanner input = new Scanner(System.in); System.o...
asked by 02.12.2015 / 13:35