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
-
0
votes1
answer120
viewsWhile error in joption pane: loop
I’m having a serious problem with while in the following algorithm: You have a data set containing the height and gender (male, female) of 50 people. Make an algorithm that calculates and writes: 1…
-
0
votes1
answer37
viewsPHP regular expression - Text of a website
I have a string Value of the Cause: <'span id="i_valorCausa'">51.899,51<'/span'><'BR'> I need to get what’s in between <'span id="i_valorCausa'> <'/span'> I tried so:…
-
0
votes1
answer28
viewsDesktop application position
Everybody good afternoon I’m having a problem I’ll try to explain: I created a desktop app and need your onscreen position to take a picture... first step catch posY,and X with getX,GetY, already…
-
0
votes1
answer1147
views -
0
votes0
answers186
viewsReturn string array in c
I am trying to return an array of strings to use later in main. Here is my function: char **separar_palavras2() { setlocale(LC_ALL, "Portuguese"); FILE *arquivo; arquivo = fopen(ftexto, "r"); int i…
-
0
votes2
answers323
viewsFunction that returns next character in PHP ASCII table
I would like to make a function in PHP that would receive a character and return the next character, according to the ASCII table. For example: receives 'a' and returns 'b'. I know how to do this in…
-
0
votes1
answer92
viewsCustom sorting in Python
I have a list foo = ["BCB", "CAB", "CBC"] and a specific alphabetical order bar = "ACB". The result with that specific order should be resultado = ["CAB", "CBC", "BCB"] How do I sort that list?…
-
0
votes2
answers1542
viewsSum of Integer Numbers in a txt File
I have two txt files that contain only numbers (number per line), so I want to add line 1 + line 1 so successively until the last line of each file. Each file has the same line number. **In this…
-
0
votes1
answer223
viewsC program that reads a text file and prints the lines in reverse order
I wonder why when running the script below, the lines appear spaced, except for the first line. Input Linha1 Linha2 Linha3 Linha4 Expected output Produtos: - Linha3 - Linha4 - Linha2 - Linha1 Output…
-
0
votes1
answer763
viewsError type Mismatch: cannot Convert from String to String[] - How can I fix?
When trying to receive value through a JOptionPane in a matrix, but gives this error: type mismatch: cannot convert from String to String[] How can I correct? Follow my source code below: package…
-
0
votes1
answer1119
viewsConvert numeric value to javascript string
I am creating a receipt layout and I need the value of the receipt to be detailed in full in the body of the receipt, for example: Transform R$ 45,51 in Forty-five reais and fifty-one cents. Is…
-
0
votes3
answers1664
viewsString Format CPF on Android
I have a CPF variable that is populated with a value that comes from the database (11122233344). Before giving setText(), I need it to be formatted in 111.222.333-44. How could I do this?…
-
0
votes3
answers379
viewsHow to insert a ";" at the end of the string, program in c
I wonder what I should do for the ";" in the print appear afterward of string and not before. I’m new to programming and I’d like to appeal to your help. Thank you Input Linha1 Linha2 Linha3 Linha4…
-
0
votes2
answers493
viewsError Converting String to Numbers in Java
In my last post (do/while repeats the expression twice) was having an input overlay problem using the Scanner class, and according to the links placed in the answer, we cannot use nextLine() after…
-
0
votes1
answer867
viewsHow to convert a saved string into a . txt file, to an integer number?
Example: test = open('test.txt', 'w') test.write('6000') close-up test.() How do I convert the contents of the . txt file into integer so I can do operations with it? in case you have no way to do…
-
0
votes2
answers679
viewsStrings and Arrays, problems getting the right result
The goal of the program is to show information on one option and a 10 question survey on another option. Each discipline has 10 questions, and each discipline is done in a subprogram. the problem is…
-
0
votes2
answers2358
viewsShow only the last word of a string
The purpose of the program is to read a string, ex: read - Jose Da Silva print - Silva I mean, always print the last word of string. My logic was to read the string back to front, and upon finding…
-
0
votes3
answers161
viewsManipulation of Textbox
You simply fill in the fields Modelo, Placa, Km and it will be saved in the fields multiline down below: But when I click on the "Save" button the result is totally opposite to the expected one. I…
-
0
votes1
answer1324
viewsString with larger and smaller number of characters
I wish to return to the greater and the lesser string. Look at: nl=str(input('Digite uma string')) String=[] string.append(nl) while caractere != 'pare': caractere = str(input("Digite uma letra ou…
-
0
votes0
answers249
viewsDoubt - Generate 6 character random string in PHP
Guys, how do I generate a string like this: Z8Yjv.jpg I went to get a photo of a user here from Stack-Overflow and the name of the photo came like this. I had thought of something like this:…
-
0
votes1
answer953
viewsHow to compare String to String received in a . jsp?
I have an html page and it sends a form with POST method, I take the data like this: String email = request.getParameter("user"); When I compare the email string to another string containing the…
-
0
votes2
answers59
viewsCreate expressions in strings
Suppose I have the following string: const str = `Eu sou @if (1 + 1 === 2): um dois @endif !`; How do I execute expressions like that if? I don’t want a solution to exactly that problem, just the…
-
0
votes1
answer90
viewsDoubt in the search for sub-string, inside a string
I did everything the question asked only that I’m taking 70% error. Question link My code #include <stdio.h> #include <string.h> #include <ctype.h> int main(int argc, char** argv)…
-
0
votes1
answer236
viewsConvert String to INT
How to convert variable string fg in one whole? if (connectionIsOpened) { String s = "INSERT INTO jogador(nome) VALUES " + "('" + this.playerName + "'" + ")"; connection.executeUpdate(s); String fg…
-
0
votes1
answer36
viewsError when searching for a string
Hey, how you doing? I’m having a problem executing this code. From the second "While True" the program can not find the written product. It was registered right above. I checked this code from tail…
-
0
votes0
answers55
viewsError in String.replace Java
I’m having a hard time getting the String.replace("á","a") In my case I type Canadá and I want out houseboat, but in the output appears instead of a square, as if there were an invalid character.…
-
0
votes1
answer43
viewsHow to create an array the same size as another array without copying it?
private void InversaoString(string Texto, int Tamanho) { char[] arrChar = Texto.ToCharArray(); char arrChar2; int indice = 0; for(Tamanho = arrChar.Length-1; Tamanho>=0; Tamanho--) {…
-
0
votes1
answer297
viewsString check inside a C function
Greetings! I’m creating a C program where the user can change the state of some sensor by typing the sensor name and 1 or 0 to change the state of the sensor, being 1 for on and 0 for off. However,…
-
0
votes1
answer486
viewsInteger to String Conversion
I’m creating a cafeteria system. I created the login system and it’s working, when I went to create a page to create the logins, I’m having difficulties in converting the int for string - the…
-
0
votes1
answer255
viewsSomething equivalent to the sstream library from C++ to C
I need something similar to the stringstream you have in the C++ connection for the C language, I need it a lot because I want to make querys in a database using C (C mysql Connector). Since I had…
-
0
votes1
answer169
viewsConvert Blob to String in Anglican
Hello, I have a code in Angularjs but it only works when I am in the browser debug. $scope.upload=function(){ var newFiles = []; $scope.carregando = true; angular.forEach($scope.files, function…
-
0
votes0
answers93
viewsEvidar the change of special characters in URI writing
I’m using the google maps API in my project but I’m having a small problem. to mount the URL I am using a URI that concatenates with buildUpon like this in the example below. Uri uriBase =…
-
0
votes1
answer373
viewsASCII characters and table
I am trying to perform a URI exercise ,and in the 1 part it asks the following: In the first step, only characters that are lower case letters and capital letters shall be moved 3 positions to the…
-
0
votes1
answer182
viewsCreate a comparison string in Java
When I put to execute the code by Eclipse and arrive at the part of typing the login gives an error which I do not and does not go to the next phase that is to enter the password. I would like a…
-
0
votes1
answer40
viewsWhy does the matrix get extra lines?
private void abrirLabirintoToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog Abrir = new OpenFileDialog(); Abrir.ShowDialog(); string CarregaArq = null; string teste = null;…
-
0
votes1
answer245
viewsC separate string with commas in vectors
I want to separate each line of a file into 2 vectors: v[i]. date and v[i].value. However, when I run the code no value I print is correct, and the outputs are random values. There’s something I…
-
0
votes2
answers539
viewsFind consecutive numbers in a string in C#
I wonder if there is a simple way to find consecutive numbers (which are equal) in a string, so that it is possible to replace that string with a single value. For example: string input =…
-
0
votes0
answers76
viewsC++ - How to pass a string to a class
I have a little problem when I try to pass a string to a class. In short: in the main program I will read this string and move to the class: cout << "----- Vamos as opcoes! -----" <<…
-
0
votes1
answer20
viewsOutput redirect
comando | tee -a saida.txt How do I redirect only part of the output of a command?
-
0
votes1
answer119
viewsChange string using function parameter
#include <stdio.h> #include <stdlib.h> #include <string.h> void menu_principal(char* monstro1, char* monstro2){ int escolha; char monstro[20]; printf("King of Tokyo\n\n");…
-
0
votes1
answer131
viewsShell in C: Segmentation error and execve function, what’s wrong?
#include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/wait.h> void…
-
0
votes0
answers343
viewsHow to read PDF files using C language?
I have to read a PDF file using linguagem C and seek a string present in the file. However when pulling the file by function fopen and display it on the screen, it appears all those encoded…
-
0
votes1
answer105
viewsError when printing string
#include<stdio.h> int main(){ int numero,unidade,dezena,centena; char *unidades[]={"I","II","III","IV","V","VI","VII","VIII","IX"}; char…
-
0
votes0
answers30
viewsError showing a String
I’m asking the question Entry and Exit with Comma, I’m doing everything the question asked but I’m leading 30% error, could help me where the error may be My code #include <stdio.h> #include…
-
0
votes3
answers9117
viewsconvert a string list into a list of integer numbers
x = ['443' , '552' , '342' , '368' , '9867' , '335' , '9412' , '7436' , '1692' , '85' , '990' , '332' , '8816' , '4567' , '279' , '119' , '2290' , '234' , '9863' , '345' , '230' , '5574' , '230' ,…
-
0
votes2
answers82
viewsWhat is the difference in the assignment of an already started matrix to an uninitiated one?
char nome[10]; nome = "w" //Aqui ocorre um warning, por quê isso ? char nome_dois[10]; nome_dois[0] = "w" // Aqui e normal, como esperado. "w" is in a static memory? nome[0] is in a dynamic or…
-
0
votes3
answers856
viewsConvert a number array to a single String in php
as I transform an array of numbers into a single string in php? In the code below the variable $result is the array of numbers, and I tried to convert it to a single string with the function…
-
0
votes2
answers703
viewsquote and quotes in a string (leaving " or #39; in the View)
I’m trying to put the following text in a string, but I can’t... when I can’t find the wrong double quotes in the arroba... I’m going crazy. Can someone help me? ,{ "@type": "Listitem", "position":…
-
0
votes1
answer358
viewsprintf %s integer in C
I’m trying to make appear on the screen all characters of the string typePersonagem[0], but only the last letter of the string is coming out, someone helps me in what I’m missing? #include…
-
0
votes1
answer45
viewsString manipulation
I have a string thus: $string = "<div class="legenda">Legenda</div> <li><a href="link2">02</a></li> <li><a href="link3">03</a></li>…