Questions tagged as 'string'

2
answers

How to concatenate multiple Strings in Python?

The following c.filtraNome(nome) method queries the database (sqlite3), however, I'm not sure how to group each field and return the already formatted query as follows: Nome: Fulano Silvia Idade: 19 CPF: 00000000000 Email: fulano@em...
asked by 26.08.2015 / 20:38
2
answers

Is there a difference between strtr and str_replace?

I was looking at how the strtr and str_replace functions behaved and I noticed that, at first glance, the two seem to do exactly the same thing. Example: $translators = [ 'da hora' => 'bacana', 'ser' => 'é', ]; $st...
asked by 27.02.2015 / 13:30
1
answer

if with a matches or several comparisons?

Considering that I have a variable of type String tipoResidencia that will never be null, and that I need to run a test, the default solution is this: if (tipoResidencia.equals("CASA") || tipoResidencia.equals("PREDIO") ) But if I wa...
asked by 14.08.2015 / 22:14
1
answer

Is there an associative array type data structure in Java?

Well, I'm trying to name an Array of Strings in Java, but I wanted it to be, for example: String[] symbols; And that could be stated like this: symbols["name"] = "Tiago"; I know that Array does not exist like this, but in some other wa...
asked by 13.01.2015 / 22:10
1
answer

What is CultureInfo.InvariantCulture?

I have installed Resharper and in this section x.Id.ToString() it suggests changing to x.Id.ToString(CultureInfo.InvariantCulture) . What is CultureInfo.InvariantCulture and why is it better?     
asked by 06.10.2015 / 20:03
2
answers

Manipulating String in Java

I have text inside a String. I'll go through this String. As I go through it, I must take every word it contains. I thought about using string.split(" "); but I need to treat. "" ";" "," ":" "!" "?" among other cases. How can I do this?...
asked by 05.08.2014 / 15:17
1
answer

Remove accents from a string in php [duplicate]

To have problems with the accents in my code and wanted to remove the accents when doing the search, Ex: Search: Hello | Hello. When doing a Music search on the site it returns the url like this: search.php? q = Music And it does no...
asked by 05.02.2015 / 23:51
4
answers

How to format a value in JavaScript?

What is the simplest way to format 1234213412341 to 1234.2134.1234-1 using JavaScript? <script> function formatar_valor(strvalor){ var formatado; // formata return formatado } alert(forma...
asked by 20.03.2015 / 05:40
3
answers

How to give a Regex before a string? And select?

What I need to do is this: let's assume the string is - > : . However, I want to select "only" the string before : using Regex . To get clearer: " select this word : another word here" Remembering that :...
asked by 09.01.2018 / 18:44
5
answers

Remove last comma from an array

In this code below I have an array that returns me a comma at the end  exe: '98602', '98603', '98604', How can I remove this comma? if (isset($_POST['checkbox'])) { foreach ($_POST['checkbox'] as $key => $value) { $id = mysql_re...
asked by 06.03.2015 / 16:09