Most voted "string" questions
A string is a sequence of zero or more characters. It is commonly used to represent text or a sequence of bytes. When marking a question with this tag, also mark with the programming language to be used and the operation being attempted with the string.
Learn more…1,904 questions
Sort by count of
-
1
votes1
answer193
viewsHow to get a name inside a php string?
$resultado = "spawn needle /var/www/html/trabalho/arquivo/emboss/needle/alvos.txt /var/www/html/trabalho/arquivo/emboss/needle/modelos.txt Needleman-Wunsch global alignment of two sequences Warning:…
-
1
votes2
answers76
viewsError while creating string array
I’m having trouble trying to initialize a vector of strings my code is like this: #include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char *str[3];…
-
1
votes1
answer130
viewsSeg Fault using strcat and strcpy
This is my code: char CodificarCesar(char *texto_nao_codificado[256], int chave){ char…
-
1
votes2
answers1378
viewsRead java strings within a while or do-while repetition structure
How do I read java strings within a while or do-while? repeat structure without error and reads Code: package listas; import static java.lang.System.exit; import java.util.ArrayList; import…
-
1
votes1
answer347
viewsHow to separate Edit String in Excel
I need to separate this type of string (Example): 1 Estruturas lógicas. 2 Lógica de argumentação: analogias, inferências, deduções e conclusões. 3 Lógica sentencial (ou proposicional). 3.1…
-
1
votes2
answers83
viewsFirst item returns Undefined
I’m trying to print on inner one split, however, after passing through the for, the first value returns as undefined, could tell me what it might be? function parteTexto() { var teste; var texto =…
-
1
votes2
answers826
viewsC Password Validator
I’m trying to solve the problem 2253 - Password Validator, URI, but is giving 10% wrong answer, but all my tests are working, someone can find the error? #include <stdio.h> #include…
-
1
votes2
answers979
viewsHow to replace string values from all array values?
Good afternoon guys, well the problem is this.. I have a string with name x, and I have two arrays, name and value. in for perco both arrays where I identify if in string X has any field equal to…
-
1
votes1
answer4647
viewsHow to manipulate strings with ". find"
I can use ". find" to make the program search for a word within a typed text and say whether it exists or not?(true or false) and what line of text is located, if not, what command do I use to do…
-
1
votes2
answers401
viewsHow to display text with multiple lines with format?
I’ve been trying for several lines in a row with one string along with the method .format, but I can’t. a=input("digite algo; ") print("""contem maiusculos:{} contem: {}n\contem números: {} contem…
-
1
votes1
answer895
viewsDelete last line - Java
I’m reading a CSV using Bufferedreader by reading line by converting the result into a .txt. At the end of my txt is generating a line break after the last item. I’m trying to find a way to remove…
-
1
votes1
answer66
viewsWhen you click, I want to define the phrase through the indexes
As you can see in the code, when I click I’m randomly defining the phrase, but when I click, I want the phrase that I myself define through the indexes, how do I do this? Public class MainActivity…
-
1
votes2
answers276
viewsRemove characters from a string between two specific java characters
I have a String which contains the file path, and I need to remove the characters that come after the last "/" to the end of the string. Can anyone help me with this? ... Example: String comando =…
-
1
votes1
answer112
viewsHow to transform a text into an identifier name?
I would like to be able to receive a string as a parameter and use as an identifier name, create a variable or function with that name (it is not used as a dictionary key). It is possible to do…
-
1
votes1
answer66
viewsProblems in String and Case
I’m a beginner in programming for a little while and I have a college task in which I must create a registration system that receives the entries the customer data and then another option that…
-
1
votes2
answers875
viewsDecode data in Base64
I am working with metadata of an image extracted in Json format. One of these data is a binary string Base64. I read in documentation that these values are 16 bits. Is there any way to decode them…
-
1
votes2
answers204
viewsPrintar 2 interlaced strings
How do I print 2 interlaced strings (I don’t know if that’s what it’s called)? For example: string1='aovces' string2='m o' so that in the print "I love you guys" in the case, interspersing each…
-
1
votes1
answer6005
viewsTransform all elements of a list into floats
That’s the code I wrote. n_alunos=input('') x=0 idades=[] alturas=[] while x != n_alunos: x+=1 n=raw_input('') a=n.split(" ") idades.append(a[0]) alturas.append(a[1]) How to transform the elements…
-
1
votes1
answer131
viewsWhat error? Strtok C
I made the following code that takes a string of 3 numbers separated by space, then delimits them and allocates each number in an array position, at the end it prints the array, the code works but…
-
1
votes1
answer182
viewsString for Array/List
I got the following String: [{"Monstro":"Lobo","HP":100,"Level":2},{"Level":"1","HP":"100","Monstro":"Bruxa"}] And I need to put her inside a Array ou List to take the values of each monster. How do…
-
1
votes1
answer26
viewsphp show dates and times and phone in formats
precios mostrar na tela algumas informaçoes tipo: $time = '120034' $date = '20170508' $mes = '201704' $hunger = '62992161424' how do I show like this echo $hour 12:00:34 echo $date 08/05/2017 echo…
-
1
votes0
answers423
views -
1
votes2
answers384
viewsHow to create a regular expression
I have the following div with information <div class="endereco-item"> <h2 class="azulclaro identify">Casa</h2> <div class="entrelinha_0"></div> <div…
-
1
votes1
answer1680
viewsReplace com does not work
I’m trying to make a Replace() but it doesn’t work. I need to change \ for \\. "\r\n".Replace(@"\", "\\"); he just returns me : "\r\n" and not "\\r\\n".…
-
1
votes0
answers42
viewsHow to save questoes in an array of pointers
Good night I come here to try to dispel a programming problem that occurs to me. In this solution, I have a file with several questions, and each question can be a matter of one of the 3 following…
-
1
votes3
answers10296
viewsHow to read a string with C++ space inside a function
I’m in the second semester of H.I., and I’m sorry if it’s a trivial mistake. I need to read a name and surname, for an agenda, I am using function and already tried Getline, Cin.get(variable, size),…
-
1
votes1
answer63
viewsError in string inversion
I’m trying to reverse one string through a function only that it is giving error, however I do not know where it is wrong. Right below is my code. #include<stdio.h> #include<stdlib.h>…
-
1
votes3
answers314
viewsHelp how to take the last word of a string and add it to the top using java
I have a full name: Jais Pereira Guedes Godofredo The example below, I get the last word, but how to print with this result: Godofredo, Jais Pereira Guedes public class Aula1{ /** * @param args the…
-
1
votes3
answers840
viewsHow to obfuscate a PHP email by filling part of the characters before @ (arroba) with * (asterisk)?
I need to obfuscate the characters of the email, as I’ve seen many websites doing, by filling some characters of this email with an asterisk. I would like the code to be as complete as possible.…
-
1
votes1
answer529
viewshistogram of a c++ phrase
I made the following program to make the histogram of a sentence counting the number of letters and consonants in it but this giving error because I’m trying to get him to print capital letters and…
-
1
votes2
answers78
viewsHow to refer to a String through various values in Java (Android)?
I made a chatbot/virtual assistant and I want it to answer the same thing for different words, example: if I write "Hi" or write "Hello" it return the same answer: "Hello, how can I help". public…
-
1
votes0
answers91
viewsStrings in JAVA
I once worked with a program where I had a txt file with all Strings values and in the code I just referenced, so everywhere I used the same string I just needed to change in txt and still no…
-
1
votes2
answers13897
viewsHow to remove specific position characters from a string?
I have a string read from a file that contains a data and the special new line character ' n'. Example: dado = 'teste \n' First I check the size of the string, then I can remove the last two…
-
1
votes0
answers49
viewsImplementation of an DFA for reading multiple strings
I have to determine if the strings in the file belong to AFD. I was able to do just one string. The goal now is to read more than one string, but I could not do the implementation, always ends up…
-
1
votes1
answer252
viewsType error: not all strings converted during formatting
I’m trying to make a match or a match. The problem is that every time the sum of my move and that of the computer is 'even' this error message appears. I have tried other types of formatting and…
-
1
votes1
answer75
viewsPython language format function in C#
int varvalor; int var01 = varvalor * 1; Console.Write("Digite um número para ser multiplicado: "); var01 = Convert.ToInt32 (Console.ReadLine()); Console.WriteLine(); I wanted to write on…
-
1
votes1
answer300
viewsConversion of float to string - how to display two or more decimal places?
I have the code below, which returns values of type float. How can I get the result presented to two or more decimal places? private void btnDividirActionPerformed(java.awt.event.ActionEvent evt) {…
-
1
votes1
answer109
viewsDisplay higher word frequency per line and calculate number of words per line
I have the following text and I have to display the words that appear most frequently per line and calculate the amount of words each line This is a really really really cool experiment really Cute…
-
1
votes1
answer67
viewsPick string by format
I have an array of 1000 indexes with texts and random numbers stacked together, I need to take this text snippets that are in particular formats that contain pre-defined amounts of characters, such…
-
1
votes1
answer574
viewsHelp with scrambled words
I need help in a program, I have no idea how to do, the statement is as follows: "Scrambled Word - Implement a program that, from a word bank, randomly selects a word, shuffles the letters and gives…
-
1
votes4
answers9882
viewsProgram to discover repeated characters in strings and print backwards
I need to find out how many and which repeat characters are in a string (after you inform it). And also print this string backwards. I’m having great difficulties. Here is part of the code I’ve made…
-
1
votes1
answer198
viewsWhich string library can I use?
I’m refactoring a code that uses the eclipse plug but I want to turn it into pure java. The idea is to transform String into something with this style: Person@182f0db [ name=John Doe age=33…
-
1
votes0
answers422
viewsRemove blanks from a string and join it
I have a string of a Logical Expression Ex: ((T ∨ F → T) ∧ (T → F)) → (∼F → T) I need to remove the blanks from the string and join them as a result: ((T∨F→T)∧(T→F))→(∼F→T) How can I do this in…
-
1
votes0
answers99
viewsProblems with Java Strings
Guys, I’m running a data migration from a csv file to an H2 database. In this process I use the beanio to read the file and transform it into objects and then persist the objects in the base using…
-
1
votes3
answers582
viewsHow to remove spaces before and after a string without the Javascript "Trim()" method
I have this code to remove the first and last spaces but it’s removing all the spaces present. Follows: const separador = ' '; function filtro(separador, str) { let resultado = ''; let stringNova =…
-
1
votes1
answer62
viewsAssign string value with pre-defined size inside the pointer
You need help with dynamic memory, I can’t understand why I can’t access nome of ptr in the method adicionarSocio? How can I change this field? I have to do malloc of the name before assigning even…
-
1
votes1
answer495
viewsAndroid Studio set a string in various textview
I am studying the Android Studio and I ended up facing a problem, and I needed a light. I made several textView on the screen of my application and when I press a button I would change the content…
-
1
votes2
answers64
viewsIs it possible in PHP to recover part of a string using the same notation as Python?
I have the following variable for example: $teste = 'Uma frase qualquer!'; In Python, for me to get the word back frase, I would use the notation variavel[inicio:fim]: teste = 'Uma frase qualquer!'…
-
1
votes2
answers173
viewsHow to read only one line from a file in c#
I know how to read the whole file but how can I read only one line EX: read line 3 only
-
1
votes2
answers10008
viewshow to remove n from a python string
I’m trying to delete control sequences (\n, \t, \u) of strings in Python and I can’t even with replace, nor with re.sub(). How could I do? I tried, and they didn’t work : p = re.sub('\n', '', p)…