Questions tagged as 'string'

2
answers

Trying to understand Java print

Look at the code below; public class Dois { public static void main(String[] args) { int a = 3; int b = 4; System.out.print(" " + 7 + 2 + " "); } } The result is 72, but I thought it was for the result to...
asked by 14.10.2018 / 13:06
1
answer

Capturing part of the string between certain characters repeated N times

I have a string that has the format of routes: /foo/ /{bar}/ /foo/{bar} /{foo}/{bar} /{foo}/bar/ Can have many values between slashes, values between {} are variable I wanted to catch all occurrences of {qualquercoisa} of t...
asked by 13.09.2018 / 15:52
1
answer

Error in lexar a mathematical equation

I am doing an equation interpreter in C ++ and am trying to show the type of the symbol. But I'm in trouble. I do not know what's wrong. Any constructive tip is welcome. main.cpp : #include <string> #include <iostream>...
asked by 19.06.2018 / 23:01
1
answer

Get values separated by spaces in C #?

I want to get the values, for example, 79 201 304 and store in a vector each number in a position. Example: int array[0] = 79; int array[1] = 201; int array[2] = 304; public static int Descriptografa(string txt, int p, int q, int d, int...
asked by 07.11.2017 / 15:45
1
answer

Raw String Literals Java

I saw that in JDK 12 it is possible to make raw string literals similar to some programming languages like C #, JS, R etc. Ex in C #: "Essa não é uma \n raw string"; Output: Essa não é uma raw string @"Essa é uma \n raw string";...
asked by 28.11.2018 / 05:15
1
answer

How to get the same result of strcpy () with strcpy_s ()?

I downloaded a code in C ++ from the internet and when I open the solution, it gives the following error:    Error C4996 'strcpy': This function or variable may be unsafe. Consider   using strcpy_s instead. To disable deprecation, use   _CRT_...
asked by 20.07.2017 / 19:28
2
answers

python - Delete characters from the end of a string

Is there any way to delete characters at the end of a string in python? For example:     a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"     B="ABCDEFGH" I need the string "a" to be the same size as "b", is it possible? I need them the same size to do a cr...
asked by 15.04.2017 / 15:39
1
answer

Retrieving accents from a string with PHP

I'm using friendly urls and to generate the link, I'm using it this way: $string = $jm->NomeCategoria; // retorna roupa de verão $hifen = preg_replace('/[ -]+/' , '-' , $string); // incluo o hífen $acentos = preg_replace( '/['^~\'"]/', null...
asked by 20.10.2017 / 18:06
1
answer

Remove accents - [\\ p {InCombiningDiacriticalMarks}] vs [^ \\ p {ASCII}]

I created a code in Java to remove the accents like the following: private String removerAcentos(String texto) { texto = Normalizer.normalize(texto, Normalizer.Form.NFD); texto = texto.replaceAll("[\p{InCombiningDiacriticalMarks}]",...
asked by 15.11.2016 / 13:48
1
answer

How to replace bar and space by semicolons in C #

I want to create a system that removes all slash and spaces by semicolons, for example 4587 / 5458 = 4587;5458 4587 5458 = 4587;5458 How can I create this system with C #? My code so far looks like this: private void bt_validar_Click...
asked by 05.08.2018 / 04:21