Questions tagged as 'string'

2
answers

What is the equivalent of 'explode' from PHP in Python?

In PHP, if I want to split a multi-part string based on a delimiter, I use explode . How can I do the same in Python?     
asked by 15.06.2018 / 05:33
2
answers

Picking specific characters from a string?

I'm getting the following String in Javascript: Nome Sobrenome <[email protected]> How do I get only the email that is within <> ??     
asked by 31.08.2017 / 16:12
3
answers

Format String

I have the following sample code: String _randomTag = "pvp"; String _randomTag2 = "otherName"; String _format = "{tag} {player} {" + _randomTag + "} {" + _randomTag + "} > {msg}" String _result = _format.replace("{tag}", "MODERADOR").replac...
asked by 04.01.2017 / 16:06
2
answers

Bold parameter C # [closed]

I have the following string: string frase = string.Format("A data de hoje é: {0}", DateTime.Now.Date); Is there any way to make the parameter bold?     
asked by 30.08.2017 / 14:57
1
answer

Compare two strings in C

Hello everyone, I want to compare two strings but the result is not returning what is expected, which in this case would be the index in the search_name function, the error is in the fourth line of the search function, but I am making all the cod...
asked by 07.11.2014 / 14:32
2
answers

Convert hexadecimal to integer

I have this value in hexadecimal "E365A931A000000". I need to convert it to integer I'm using the following code. string hex = "E365A931A000000"; CodLibercao = Convert.ToInt32(hex); This code is giving me the following exception:    "...
asked by 03.03.2015 / 21:22
4
answers

Take accentuation of a string

I am getting a string by POST, and I want to take accent and add '_' if there is white space. I used strtr but it does not work for me. if (isset($_POST['txtnome'])) { $txtnome= htmlentities($_POST['txtnome']); } $aa = strtr($txt...
asked by 11.12.2014 / 12:16
5
answers

How to use str_replace in single quotation marks without removing the ones that are needed?

I'm fiddling with a database of a friend who has had some data entered wrong or a bit confusing or it's me that's making it difficult.    Ex: Mariana "Gurizinha's" This example was saved to the database as follows: \'Gurizinha\'s\'...
asked by 18.02.2014 / 17:24
1
answer

Store part of a string in a variable

I get the string below, through a response.StreamReader : 240144|000|5511946724649|2015-08-30 21:45:51|2015-08-30 21:46:02|1| How do I proceed to store the contents between the pipes each in a variable?     
asked by 02.09.2015 / 04:44
2
answers

Turn string into number

I have a problem that for many is simple, I have a code that takes the value of a input of type hidden and when I get this value, I add +1, that is, if the value is 3 it add +1 and has to stay 4: var total = $("#total").attr('val...
asked by 06.03.2015 / 19:35