Questions tagged as 'string'

1
answer

How to remove characters from a string?

The program should read two strings and remove from the first string all the letters that occur in the second string. Example: Let the strings be "chocolate" and "hollow", so the program should print "hlte". How to solve the problem using string...
asked by 28.03.2016 / 20:42
2
answers

Concatenate text with variable char in printf

I need to concatenate the person's name (variable) with a text. Following logic, it would look like this #include <stdio.h> int main (void){ char nome[6]; printf("Ola! Insira seu nome, por fovor: \n"); scanf("%c", &nome)...
asked by 10.04.2016 / 02:03
1
answer

Typedef struct with C character vector is not working

I'm trying to create a constructive data type, but I'm having trouble with the strings. typedef struct { char nome[30]; int idade; } p; p x,y; x.nome = “ana”; x.idade = 20; y.nome = “caio”; y.idade...
asked by 02.02.2017 / 01:02
1
answer

Difference between // and / * ... * /

As far as I understood, using // to comment on a line and /*...*/ was the same, with the difference that the second spanned more than one line if necessary. There is SOME difference between doing // var a = 'teste' and /...
asked by 28.11.2018 / 15:31
3
answers

How to implement std :: to_string for floating point?

This question may seem more like a request, but I've been researching it for 2 months and I do not know how to solve it. I need to implement std::to_string in C ++ ( without headers ) in a way that accepts decimal values ( float, doubl...
asked by 29.01.2014 / 20:39
2
answers

Identify string between two known strings in a string

I would like you to help me with the following: Given this CGC UUC GCU UUG GAA AAU UUG UGU GUU UUU UGU GGC UGC UCG CUG CUC AAA UUG UUC GCU GCU UUU UGU GUC CUG GCU GCU UUU AUU AUU UUA CGC UGC UUG GCG CUG CUY UUA CGC UGC UUG GGC UUG UUG UGG C...
asked by 31.10.2017 / 21:46
2
answers

How to convert a string with minutes / month / year in TimeStamp?

I am making a test code only. In it, I have the following String : String tempo = "1s"; //1 segundo This string is modified all the time: String tempo = "30d"; //30 dias So, I want to convert this string which can be s(segun...
asked by 10.12.2016 / 16:25
2
answers

Compare using String.Contains () disregarding accents and case

I know the //historico e searchC são ArrayLists, no caso do case utilizei o //toUpperCase() para igualar, porém, em questão de acentos ele não retorna //nenhum valor, mesmo estando exatamente igual ao valor da linha do array int i = 0;...
asked by 13.04.2018 / 05:26
1
answer

Get specific amount of characters from a textbox

I'm trying to get a specific amount of characters typed into a texbox, the current code is as follows: novaconfiguracao.CupomEstabelecimento = tb_NomeFantasia.Text.Substring(0,48).ToString(); In case of typing less than 48 or more than 48 g...
asked by 05.12.2014 / 18:58
2
answers

Why do some functions that work with C strings start with *?

In one of our classes we were taught that when a function receives as a parameter a vector, it is actually receiving the memory position in which it is allocated, so it is not necessary to return any value since what will be executed within the...
asked by 28.04.2017 / 16:45