string

How do I remove accents in a string?

I have a string áéíóú Which I want to convert to aeiou How do I remove accents? I need to save in the database as a URL.

How to provide a specific amount of strings to be tested?

I can test whether a string provided by the user is a palindrome or not (word or phrase that can be read from back to front i ... = stringTodaMinuscula[::-1] if stringInvertida == stringTodaMinuscula: print "SIM" else: print "NAO"

How to remove characters from a string?

The program must read Two strings and remove from the first string all the letters that occur in the second string. Example: ... raw_input() string2 = raw_input() stringresultante = caracteres da string1 - caracteres da string2 print stringresultante

Java-palindrome string inversion

I'm trying to do an exercise where I need to invert a word, phrase, or number and check if it's palindrome. For words and num ... er inverteString(String entrada) { StringBuffer SB = new StringBuffer(entrada); SB.reverse(); return SB; } }

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 = ... , ""); return texto; } I would like to know the difference between [\\p{InCombiningDiacriticalMarks}] and [^\\p{ASCII}].

What is the correct way to concatenate strings in JavaScript?

I started learning Python and was told that I should not concatenate the strings with , but use the .format() method. And in JavaScript it is correct to use + or , to concatenate the strings or is there a more recommended and more used way?

What is the best way to concatenate strings in Python?

I know I can concatenate strings with +=, +, join() and append(). They all give me the same result when I concatenate Two str ... gs. What is the best way to concatenate strings in Python? What is the difference between those mentioned? When to use each?

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

I am creating a variable: char nome[20]; After this, I am asking the user to enter with a name: printf("Digite um nome : " ... (const char*, const char*)' Would I have to convert the variable with the function toupper() before the if? Or inside it ?

How to read text files and put the words in a vector?

I need to make a code that reads a text file (txt) and save only the words in the positions of a vetor, below follows My Code ... x[i+1] = '\0'; printf("%s", x); fclose(file); return (EXIT_SUCCESS); } But from this I do not know how to do.

How to manipulate strings with".find"

I can use the".find " to make the program search for some word within a typed text and say if it exists or does not exist?(tr ... at command do I use to do this? What I have so far: a = str(input()) #output: Criando um exemplo. print(a.find('exemplo'))

How to remove position-specific characters from a string?

I have a string read from a file that contains a data and the special newline character '\n'. Example: dado = 'teste \n' ... e string, then I can remove the last two characters, but how can I remove pointing to the specific position of the character?

How can I replace a part of a string with itself plus the character "~"?

How can I replace a part of a string with itself plus the character "~"? I'm doing as follows: only when the string has ... match.Value + "~"); match = match.NextMatch(); } System.Console.Write(lista); } }

How to split a string into specific sizes in JavaScript?

I need to split a string into specific size in JavaScript. I know that it is possible to use Join to transform a string int ... erflow', 3) Result: [ "sta", "cko", "ver", "flo", "w", ] Is there any way to do this in JavaScript?

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

I'm making a code for testing only. In it, I have the following String: String tempo = "1s"; //1 segundo This string is m ... if (tempo.endsWith("s")) { added = (tempoSemLetra)*1000; else if (tempo.endsWith("d")) { //Como converto os dias? }

Convert String to Integer on Android

Guys, I had already opened a question regarding this subject but in java (here), I could not solve and now in an Android apk ... RespostaIntent"/> </intent-filter> </service> </application> </manifest>

What is the difference between the replace() and replaceAll () methods?

Was reading the documentation to properly develop a mask and save without it. However I came across this doubt of the replace and replaceAll methods for my string. What's the difference between the two, apparently both serve the same purpose.

Is there a difference between using backslash and plain?

I want to know if when it comes to doing upload of a file, like this: $destino = 'imagens/' . $novoNome; Is there a difference between imagens/ and imagens\?

What is the difference between varchar and nvarchar?

What is the difference between using the data types varchar and nvarchar? nvarchar exists in every SQL database? is ther ... is there a criterion for using them? And I saw that there is also the same with char and nchar. Does the same apply to them?

How to check if the string variable value is number?

I am developing a program where the user enters a data, then I have to check if the value is number to proceed with the opera ... numeric character the program will present error, when in fact I would like to treat this by asking her to type only numbers.

Algorithm in C to convert Arabic number to Roman Number

How to do this conversion? Does not need to be the algorithm ready, wanted a help at least in logic.