Questions tagged as 'string'

4
answers

String manipulation - split ()

Is there any way to give split() to string and on the same line get the position I want? For example: String nome = "Dan Lucio Prada"; String sobrenome = nome.split(" "); //aqui quero pegar só o sobrenome [Prada]     
asked by 18.09.2015 / 22:01
3
answers

Extracting numbers from a String

I have a String in the following format: 01 - 02 - 03 - 04 - 45 - 86 I need to put these numbers in array int[6] . What is the best way to do this?     
asked by 27.03.2014 / 19:31
2
answers

How to extract only numbers from a string?

I want to extract only the numbers of a CPF that is in a string in that format;    111.222.333-44 You only have to return:    11122233344     
asked by 15.07.2014 / 19:51
2
answers

You can concatenate numbers of type int

For example 10 and 12, concatenated would be 1012, this would not be string , it would have to be integer type, can you do that?     
asked by 08.02.2018 / 16:07
3
answers

Size of a String

A char in the C language takes up 1 byte in memory.Ex: char ch;//a variável ch esta ocupando 1 byte na memória And a vector of char better known as string , its size in bytes will be counted according to the vector numbe...
asked by 30.09.2016 / 16:21
3
answers

Assemble a single string with several strings of an ArrayList in Java

How can I get multiple Strings from an ArrayList in a simplified way and merge into just one string variable? I'm new to Java and I'm having trouble completing this change in a simplified way, avoiding long, unnecessary lines of code. List<...
asked by 17.06.2015 / 22:21
1
answer

Checking string within string

How to tell if specific text is contained in a string ? example: String str = " Hello Word"; How do I check to see if the word "Hello" is contained in that string "str". And if the check is true, how do you edit it? If the word...
asked by 16.07.2015 / 03:04
3
answers

Convert string number to PHP integer

I am converting a string to integer in PHP, however in the return of settype($variavel, "integer") , or (int)$variavel bring me a null value or equal to 1. Is there another way to try the conversion? The code I'm having is thi...
asked by 31.08.2015 / 21:22
2
answers

Accept only numeric input

nota = -1 while nota < 0 or nota > 10: nota = int(input("Informe a nota entre 0 e 10: ")) if nota < 0 or nota > 10: print("Valor inválido") I need to include in this validation code for, if the user types string (a,...
asked by 09.10.2017 / 21:28
1
answer

PHP says that two equal strings have different lengths

I'm trying to compare two strings, but something unusual happens. I have the code: <?php $char = 'Á'; var_dump('Á'); var_dump($char); The variable $char receives 'Á' and the result is as follows. string 'Ã' (length=2)...
asked by 21.07.2014 / 10:08