Questions tagged as 'string'

1
answer

Use CONCAT or CONCAT_WS in MySQL?

As we already know, MySQL has two functions to concatenate strings: CONCAT and CONCAT_WS . Responding to a question, I saw that CONCAT does not yield the expected results when at least one of the values equals NULL ....
asked by 13.07.2017 / 16:12
1
answer

Scanner.nextLine () does not act correctly after Scanner.nextInt ()

I have this code: Scanner scan = new Scanner(System.in); String s2 = scan.nextLine(); int i2 = scan.nextInt(); System.out.println("natural= " + i2); System.out.println("cadena = " + s2); scan.close(); That works correctly:    This...
asked by 02.09.2016 / 11:45
2
answers

String.format vs. StringBuilder vs. String.Concat vs string + string

I'm doing a log in .Net which before and after each process will be filled string with the message: "proceso x realizado \n" "proceso y saltado \n" //porque o se realiza x o y "proceso a fallo al sumar \n" "proceso n [...] \n"...
asked by 24.02.2017 / 00:40
5
answers

How to convert an HTML element to a string in javascript?

I access an element of my page and I save it in a variable: var nodo = document.getElementsByClassName('prueba'); if I do a var nodo = String(nodo); It does not work for me, I know it's an array of objects but if I pass it to a string...
asked by 24.02.2017 / 13:10
5
answers

JAVA String: Difference between Null and ""?

public static void main(String[] args) { String frase; String palabra = ""; String mostrar = null; int i; int c = 0; frase = JOptionPane.showInputDialog("Ingrese al frase: "); frase += " "; for (i = 0; i...
asked by 17.06.2017 / 10:12
2
answers

Print variables and strings in PHP, single or double quotes

I do not finish clarifying myself on how to combine variables and written strings directly. We are going to use the variable $test : $test="prueba"; Case 1 .- Enclose the variable in double quotes " " works: echo "Esto...
asked by 04.08.2017 / 22:03
2
answers

Go through a ListBox and put its items in an array

I fill a list from OpenFileDialog and I put it in "file" and then put it on the list like this: foreach (string file in selectedFiles) { ListBoxItem lstItem = new ListBoxItem(); lstItem.Content = file; //File es la cadena de la...
asked by 22.04.2016 / 13:46
3
answers

Replace strings with replace JS

Hello I have the following code in JS that detects me in a block of content if it has any of the following sequences of characters and they have to be replaced by images, the problem is that the replace function does not allow me to replace them...
asked by 28.04.2018 / 20:27
2
answers

replace values in symbols in a string

I have the following string: Var text='¡Hola $var1$! Gracias $var2$' How can I replace what is between $ by the value of the variable. Example: var1="Juan", var2="Pedro" Resultado='¡Hola Juan! Gracias Pedro' The text can have more var...
asked by 11.07.2017 / 16:47
2
answers

Read long text with voice on Android using TextToSpeech

I am implementing text reading with voice in
asked by 11.10.2017 / 16:32