Questions tagged as 'string'

2
answers

Error using string of values

Hello, I'm using string within values. It's all working fine, but when the sentence is made up of something that comes from the bank (for example) and a string, it's putting numbers instead of text. numeroAvaliacoes.setText(" " + object.get...
asked by 12.12.2016 / 14:05
1
answer

How to improve comparison and string concatenation C #

I have the following code: private static string MontarDescricaoOrgaoUoUe(RequisicaoFisica requisicao) { return !string.IsNullOrEmpty(MontarNomeOrgao(requisicao)) ? MontarNomeOrgao(requisicao) : !string....
asked by 29.09.2015 / 22:12
2
answers

Check a character pattern for login

When using class Regex of C # I wanted the string nomeLogin Do not allow it to start with numbers or special characters. only allow "_" or "-" or "." as special characters. minimum of 2 characters being the first...
asked by 30.08.2015 / 21:39
2
answers

Python, Cipher of Caesar, Strings

Hello, I would like to ask some tips to improve the code, especially in the 'geraMsgTraduzida' function, to make the code look better if it is possible. def recebeModo(): """ Função que pergunta se o usuário quer criptografar ou de...
asked by 15.09.2018 / 03:57
2
answers

Separate String with .Split - C # [duplicate]

Good morning, I'm trying to get a specific part of a string in Visual Studio, in case the string in question is a directory path: "C: \ Users \ User \ File-2018.txt" I would like to try to get only what comes after the last "\", I tried to...
asked by 13.08.2018 / 16:16
3
answers

Removing characters from a string - Python

Well, I have the following problem. I have a function that returns me the following output: "Address:58.200.133.200" I would like to save this value to a ip variable, but I want only the ip part from output, so I get ip = "58.2...
asked by 25.09.2014 / 21:48
1
answer

Take number by number of a sequence of numbers to compare them

My teacher of algorithms and programming techniques spent an exercise in which a = "123567348" and of that I would say which numbers are even and which are prime. He said he would have to use substr() , and passed an example: #inc...
asked by 15.10.2018 / 22:57
1
answer

Python - Sort list strings by number of ascending letters

Having the following list: lista_nomes =['Manuel', 'Laura', 'Antonio', 'Jasmim', 'Maria', 'Silvia', 'Lu', 'Pancrácio', 'Diogo', 'Ricardo', 'Miguel', 'Andre'] And wanting to sort it by increasing number of letters. Now, I'm not getti...
asked by 02.05.2018 / 10:24
2
answers

How to replace part, of specific order, of a string?

I would like to know how to replace part of a string, but only part of order N. For example, replace the second (so only) "and" with "electricity."    Entry: Electricity       Output: Electricity Maybe it's simple, but I'm a layman on...
asked by 09.06.2018 / 06:12
2
answers

Help with String algorithm

I need to make a program in which the user types a string and substring, and tells how many times this substring occurs in the main string. Ex: Main chain: "banana" Substring: "na" Repetitions: 2. I've already thought about using a String vec...
asked by 24.02.2018 / 14:27