Questions tagged as 'string'

2
answers

How do I check if there is a special character or number in a string in C?

I'm confused in logic to see if you have other characters than alphabetic characters. I thought the following logic, but I think it is wrong: char nome[30]; scanf("%s", nome); int especial = 0; for(i=0; i<strlen(nome); i++{ if(!(nome[i] &...
asked by 11.07.2017 / 00:04
3
answers

Function contrary to TRIM

How to insert characters into a varchar field in MySQL? For example, in the update with trim vc you can remove certain characters from a field varchar ... but add? Example: update tabela set campo = TRIM(leading '11' from...
asked by 12.02.2016 / 12:59
3
answers

Invert string in C

I'm trying to invert a string into C but the function is cleaning it: for(i = 0; i < (int)(size/2); i++) { tmp = buffer[i]; //armazena o character inicial buffer[i] = buffer[size - i]; //Troca o character da ponta oposta buffer[s...
asked by 01.07.2016 / 20:27
4
answers

Count distinct names saved in txt

I have a txt file with users' names separated by line as follows: diego sergio antonio maria diego antonio Note that names can repeat, and I would like to list and list only the distinguished names. I made this method to list the whole f...
asked by 16.02.2016 / 11:19
3
answers

I want to change a string in 3 positions

I would like to walk 3 positions with a letter from a string , for example, make the letter A turn D, I tried the second command: texto[c] = texto[c] + 3 But it still does not work, what would be the right way to do it?     
asked by 08.11.2017 / 20:45
2
answers

Palindrome check function

I have the challenge of writing a code to check if a text is a palindrome or not. I have not finished the code at the moment, it's like this: function checkPalindrome(str) { var direita = []; for(var i = 0; i<str.length; i++){...
asked by 15.07.2018 / 20:40
5
answers

String Format with JavaScript

Aiming for the String.Format of C #, which is very easy to use, I have searched for something similar to be used in my JavaScript codes. I found some implementations that are somewhat problematic, so I would like you to have someone wh...
asked by 27.08.2015 / 14:41
2
answers

How to convert string (in Portuguese) into date?

I have data.frame with a column (month) that represents the month and year of each remark that is in the form of a string. I would like to modify it to date so I can use the proc in excel with date. How can I do it? mes...
asked by 26.07.2017 / 16:31
3
answers

What is the correct way to concatenate strings in JavaScript?

I started learning Python and was told I should not concatenate the strings with , but use the .format() method. And in JavaScript is it correct to use + or , to concatenate strings or is there a more recommended and...
asked by 23.08.2017 / 01:18
2
answers

How to hide a string in C, so it is not readable in compiled code?

I have a string Hello World , but I do not want to save it as Hello World in C, I would like to save it as some base64, aes or binary value, or similar, so that it would not be readable in code . How can I save this string, and r...
asked by 21.07.2016 / 20:45