Questions tagged as 'string'

2
answers

Invert "string"

I have the following function: void InverterString(char *str1){ char aux[strlen(str1)]; for (int c=0; c<5; c++) aux[c] = str1[4 - c]; printf("A string1 invertida fica: %s", aux); } However, it prints the phrase that is in...
asked by 24.08.2018 / 20:50
2
answers

How to put between inside a query in code?

I have the following query and would like to put in the Where clause the condition of being within a certain period. public static DataTable stCloseCaseAll(int schoolId, string dataInicial, string datafinal) { var sb = new StringBui...
asked by 15.05.2014 / 19:41
1
answer

What are the advantages of using sprintf instead of concatenating strings?

I know the sprintf function is for formatting strings and can replace concatenation. I can see one advantage: readability. But the other advantages I can not see. Besides readability (due to separation), what are the other advantages of...
asked by 05.10.2018 / 16:14
1
answer

Strings handling with str_replace

I'm trying to treat a string with the function str_replace however I wanted to insert a <span> before before the treated word, as in the example below: $entrada = array("//"); $tratamento = array("<span class='comentar...
asked by 09.02.2014 / 18:52
2
answers

Change letter by number in C

I'm trying to program a phone algorithm with the old keys where the user will enter the letters as input and the output will return me in the form of numbers. Look at an example below: Entry: Hello-World Output: 43556-96753 I've tried t...
asked by 04.11.2018 / 22:01
1
answer

Replace with \ does not work

I'm trying to make a Replace() but it does not work. I need to change from \ to \ . "\r\n".Replace(@"\", "\"); It only returns me: "\r\n" and not "\r\n" .     
asked by 04.12.2017 / 19:59
1
answer

Location of a character in python

I adapted a program in Python that solves labyrinths, and I am improving it, but I had problems with the minimum path (I even studied it in Graphs), I was able to understand everything. But I have trouble finding the position (x, y) of the targe...
asked by 25.02.2018 / 13:19
2
answers

ASCII in Python

Hello. I come from C and I'm starting to learn Python. I have a question to move the characters of a string 3 positions and in C would look something like this: str[i] += 3; I tried to do the same thing in Python and it ended up causing an...
asked by 03.02.2018 / 19:47
1
answer

How to join two tables using auxiliary table and LINQ

I have the People and Representatives tables, where in my application the person may or may not have representative (s). public class Conta { int PessoaID; string Nome; String Documento; } public class Representante { int Rep...
asked by 05.10.2017 / 20:16
1
answer

Compare a string array with another string array and create a new array

I need a method / algorithm found in array1 strings of array2 and create a new array ( array3 ) with all stings separated from array2 . For example array1 = ['azxsdfghjkazxfgtfgt']; The array2 would...
asked by 18.10.2017 / 17:19