Questions tagged as 'string'

2
answers

What is the problem of returning a local variable?

What can happen if I return a local variable? I read on the internet that it is not a good idea to return a local variable. Maybe because the variable when exiting the function is deleted? Example: std::string StrLower(std::string str) {...
asked by 22.04.2018 / 14:56
3
answers

Transform a string into several substrings whose contents are in apostrophes

I am creating a program in C # that reads a text file and one of the lines of this file has the following format: 'Column 1' 'Column 2' 'Column 3' I want to turn this line into an array of strings so that the answer looks like this:...
asked by 25.11.2016 / 18:44
1
answer

Special Characters in StreamWriter with Encoding.ASCII C #

I am writing to a file via StreamWriter using Encoding.ASCII encoding. A situation appeared in which I need to write the letter "Ç". But if I try to do this, the file exits the "?" Character. In this case, I need to use this encoding (I can n...
asked by 02.10.2015 / 14:22
2
answers

Call a method equivalent to a string

Consider the following class: public class AnimationManager : MonoBehaviour { public GameObject[] Enemies; void OnTriggerEnter2D (Collider2D o) { if (o.tag == "Player") foreach(GameObject Enemy in Enemies)...
asked by 31.08.2015 / 21:30
1
answer

Adding a comma to a string

Good personal and possible add comma in an example string: a = '1234567890abcdefghijklmnopqrstuvwxyz_' So that she stays like this a = 1,2,3,4,5,6,7....     
asked by 04.12.2015 / 22:13
1
answer

How to use the toupper () function in char in C?

I'm creating a variable: char nome[20]; After this, I'm asking the user to enter a name: printf("Digite um nome : "); scanf("%20s",&nome); And I'm checking to see if the name is correct: if(strcmp(nome,"Maria") == 0){ pri...
asked by 28.03.2017 / 20:06
1
answer

Is it possible to show exception message in pt-BR?

I would like my exception message to be displayed in Portuguese, would anyone know how? catch (Exception ex) { Debug.Writeline(ex.Message); }     
asked by 07.08.2015 / 02:58
1
answer

How to convert string to double without rounding error?

Because the following command: Convert.ToDouble("199998,99") Results in:    199998.98999999999 Already the command: Convert.ToDouble("199998,98") Results in:    199998.98000000001 ?     
asked by 31.07.2015 / 14:47
1
answer

PHP \ xf0 represents 0xF0?

If \xF0 represents a hex as well as 0xF0 , why are their output different? echo "\xF0"; echo 0xF0; I actually do not find any information about this \xF0 notation in the PHP manual.     
asked by 26.10.2018 / 20:06
1
answer

What is the difference between performance between different types of string concatenation?

I know 4 different types of concatenation of string in C #: // string Interpolation $"valor {variavel} R$"; // Verbating string @"texto qualquer pula a linha e continua o texto"; // concatenar 2 strings "texto" + "texto"; // string.form...
asked by 28.11.2018 / 21:49