Questions tagged as 'string'

2
answers

Differences between strpos, strstr and preg_match

PHP offers numerous methods to find out if a text string contains another substring: strpos : to find the first occurrence strrpos : to find the last occurrence strstr : to find the first occurrence preg_mat...
asked by 22.11.2016 / 15:11
1
answer

Find string in file and go back up in file to extract process name

I explain: I have a java application that dumps data of all the processes running on my pc in a text file by means of a command; this file will be generated every 5 seconds for example (thread). The generated file has about 130000 lines, so it's...
asked by 19.10.2016 / 17:20
3
answers

Java Tell a character other than a word

I know how to count the characters of a word but I do not know how to make it not to repeat itself if that character was already counted The output that I intend to draw would be a "RATA" entry, an exit from R 1, A 2, T 1. public class Main...
asked by 01.03.2018 / 13:56
4
answers

Problem when changing a string word for another word in a phrase

Hello, I just need help printing the sentence already changed please. When printing I get the following: [Ljava.lang.String; @ 2a139a55 Here is my code: public static void main(String[] args) throws IOException { BufferedReader...
asked by 07.03.2016 / 06:04
1
answer

How to compare with equals a question with 2 possible answers

I'm doing an exercise in java and I have to compare the answer entered:    Do you want to continue? s / n: You must contemplate both s and S How do I do it? I can only do it with an answer     
asked by 14.07.2017 / 13:40
2
answers

My code stops adding by converting from hexadecimal to decimal

I want to convert a string of 6 bytes in hexadecimal to a float float desencapsularArchivo::hex2dec(string aConvertir) { int cantHex = aConvertir.size(); float decimal = 0; for(int hexNum = 0;hexNum < cantHex; hexNum++)...
asked by 21.02.2018 / 19:38
1
answer

Compare several elements of a matrix

I would like to know if you could help me with this little problem that I have. I'm doing a basic variation of the game tetris in console as part of a task, I'm quite new to Java, I just started and I was stuck in the system of punctuation /...
asked by 03.03.2017 / 05:24
3
answers

Count vowels of a string in PHP7

I have the following statement: I have to count the total characters of a string, count the total number of vowels, and the number of times each vowel appears. I lose myself a bit and I've done it without a loop while. I can not use arrays eithe...
asked by 04.11.2016 / 21:19
1
answer

Unexpected result using string.split ()

Given the following code: function myFunction() { var str = "<tr><td>Prueba 1</td><td>Prueba 1</td><td>Prueba 1</td>td>Prueba 1</td><td>Prueba 1</td><td>Pru...
asked by 20.08.2017 / 22:11
5
answers

How is an empty string valid?

I am trying to make a cycle that reads a string while it is not empty if it fulfills that it does not contain any character because it goes out of the cycle; but I have not been able to get a loop and it never comes out, here's my code: #inclu...
asked by 21.06.2018 / 23:43