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
votes2
answers486
viewsConversion from comma to java point
I’m having a hard time getting my own getPreco() be formatted. The input of the data is by means of a textField. if (radioGuitar.isSelected()) { Guitarra guitarra = new Guitarra();…
-
0
votes0
answers23
viewsUse char[] or char* to initialize a string?
It would be more correct to use like this: char[] nome = "Fulano"; Or so: char* nome = "Fulano"; I’ve even seen cases of starting a string like this: char nome[256]; strcpy(&nome, "Fulano"); Or…
-
0
votes1
answer107
viewsHow to concatenate two strings into C without using <string library. h>?
#include<stdio.h> #include<stdlib.h> int main(){ char vet1[20] = "Bom "; char vet2[20] = "dia"; for(int i=0; vet1[i]!='\0'; i++){ for(int j=0; vet2[j]!='\0'; j++){ vet1[i]=vet2[j];…
-
0
votes1
answer198
viewsHow can I read a txt file in C, line by line?
I’m a beginner in C, I’m trying to read a txt file that has more than one line, but when I use fgets it only reads the first line, as I can read the entire file? what I’ve done so far void main() {…
-
0
votes1
answer261
viewsHow to Read and Print String with c++ space?
I even managed to make my program read the String (name of a person) with space in C++. However, when printing only returns the first name of the person as in my program below. //Write a program…
-
0
votes2
answers69
viewsHow to see if a string has integer numbers
In this program he only analyzes whether the string has digits, but wanted him to analyze whether it has positive integers. For example: entree: a 1 b 12 c 3.14 -20 exit: a +1 b +12 c 3.14 -20…
-
0
votes0
answers16
viewsI would like to know the concept of Querystring , what is it ? , what is it for ?. I am in a class on flask and was introduced to me about Querystring
@app.route('/novo') #novo.html def novo(): if 'usuario_logado' not in session or session['usuario_logado'] == None: return redirect('/loguin?proxima=novo') return render_template('novo.html',…
-
0
votes1
answer83
viewsInvert string in C - String problem with even number of characters
Well, I have the code below that should reverse a string and show if it is a palindrome. However, when the word has an even number of characters the result is wrong. I think the error is in the…
-
0
votes0
answers61
viewsFatal error: Uncaught Error: [] Operator not supported for strings in
Hello. I have a options with custom fields in a form. I’m getting the Fatal error: Uncaught Error: [] operator not supported for strings I have read that [] is an operator no longer allowed after…
-
0
votes0
answers14
viewsProblem with Encoding Losing Accent
I get a file (*.txt) that comes as default ANSI encounter. But every time I read the file it returns me "?" in all characters that have some kind of accent or even the "ç" itself". Ways I have…
-
0
votes1
answer44
viewsTransform and return a centered string s into a length width string
In this exercise I must pass to the function a string, a size and the character I want to include in the string, but I find problems when executing it, the string that should be centered ends up…
-
0
votes0
answers23
viewsHow to convert this date string "2021-09-22T09:00:00" into standard format
I get that string in a request "2021-09-22T09:00:00" I need to turn her into this pattern with 22/09/2021 09:00 javascript Can someone help me? I need a regex to modify…
-
0
votes0
answers19
viewsHow to solve/finish this string exercise?
Code I’ve made so far: int main() { char string[100], c; int removidas; fgets(string,100,stdin); scanf("%c", &c); removidas = funcao(string, c); printf("Numero de remocoes: %d\n", removidas);…
-
0
votes0
answers30
views"Dereferencing NULL Pointer" error in a chained list structure
My code deals with a simple endadeada list (then I will implement the pointer to turn double). But in the line strcpy_s(new_element->musica_name, musica_name); He keeps giving an…
-
0
votes0
answers15
viewsHow to make next and previous buttons by Highlight?
Well, I’m having trouble executing a code to go to the next word in Highlight. I’ve tried a lot of things and I can’t seem to make it work. String text is in HTML, and I do the transformation inside…
-
0
votes1
answer220
viewsCopy one string to the other in C++
I am doing a school activity where I have a list of book titles. Each title stored in a string field of a structure. I need to sort this list alphabetically through the quicksort where I should also…
-
0
votes1
answer225
viewsIs there a way to execute an internal command stored in a . txt (or String) file in Delphi?
I am trying to display an image when loading a Form, but the command needs to come from an external file. txt (or a string that will store this existing command in .txt). I can show the lines with…
-
0
votes1
answer50
viewsButton problems, codifying/decoding texts for binary numbers
I’m making a text to binary converter in HTML/CSS/JS, but I ran into a problem that By pressing the decode button, it does not change the text where it should change, soon after I can no longer…
-
0
votes1
answer108
viewsHow to split a string into n equal parts in python 3.8 without using functions?
I want to split a string, in the case of a binary number, to convert into octal and Hex, but I need to divide the inserted number into equal parts, in the case of octal, I would need to divide it 3…
-
0
votes1
answer61
viewsConvert a sqlalchemy query to a dictionary - Python
I have this consultation made with SQLalchemy ORM, where table_schema contains an example of sqlalchemy column nq = session.query(Base.table_schema).filter(Base.tablename == 'stores').scalar() The…
-
0
votes1
answer130
viewsHow to change a specific value of a string in an array?
I have an array: let arr = ['Feijao, Arroz', 'Melancia', 'Banana', 'Laranja,Uva'] and would like her to become: let arr = ['Feijao, Arroz', 'Melancia', 'Banana', 'Laranja, Uva']//(consertando o erro…
-
0
votes1
answer108
viewsBreaking text with regular expression in Javascript
I’m trying to break a text using regular expression with Javascript, but I’m not getting the expected result. I have the following string: var texto = "texto inicial <div>Texto dentro da…
-
0
votes1
answer76
viewsHow to print lines that have a certain word in python?
I’m taking a test and she has this question : "Make a program that receives sentences and insert them into a new file called string.txt. Next the program should read the file and print only the…
-
0
votes2
answers364
viewsHow to calculate the number of times a word appears within a sentence
I’m trying to create a code in which I have to count the number of times a word appears within a sentence, but after a lot of searching and searching about, I can only find codes that use the fgets…
-
0
votes1
answer41
viewsDoubt about a String issue (C Language)
I wanted to ask a question about String, the activity asks me to print a sentence that was typed in alphabetical order, putting each word of the sentence in order. However, when I give Run in the…
-
0
votes2
answers248
viewsChecking repeated character in Python list
Hello! I’m trying to develop a program that reads a string and returns a boolean if there are repeated characters. I need enough on that score: ("") // False ("oo") // False ("po") // True…
-
0
votes1
answer62
viewsI can’t copy a string array to a string array in a struct
I’ve been racking my brain for hours, and I can’t seem to fix it. I want to copy a new string and place it in the first position of a string array in a struct. However, when I try to copy the new…
-
0
votes1
answer38
viewsHtml.Displayfor() not breaking string line
In this code, the idea is to generate a list of records searching the database and showing in a cshtml the variables, for each item in this Model. In the Database, strings contain \n (line breaks)…
-
0
votes1
answer27
viewsPL/SQL Return specific value of a variable string
I need to separate specific information from a string within a field, in case only the value "refDate:dd:mon:yy", but the string varies in each record. How could it bring about the desired result?…
-
0
votes1
answer37
viewsFilter string array in C and count how many repeat
The program makes car rentals, it takes license plate and the type of car, both stored in two different matrices, as I do to get only the license plates of the luxury type cars. Code I’ve made so…
-
0
votes1
answer36
viewsHow to return a pointer to a dynamically allocated String, declared within a function?
//Função de inversão de String. #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 30 char* invertStr(char *source) { int size = strlen(source); char *inverted…
-
0
votes1
answer32
viewsHow to create a function that deletes all spaces before and after the phrase starts in a string
My goal in this function is to have a void function that changes a string so as to cut all spaces before and after the sentence, for example: transform the string " I went shopping " in the string…
-
0
votes0
answers44
viewsWhy does the comma disappear when converting an HTML to str in Python?
I’m extracting some data from a scraping page following a tutorial I saw on Youtube. Follow the code: import requests import pandas as pd from bs4 import BeautifulSoup from selenium import webdriver…
-
0
votes1
answer75
viewsHow to make string substitutions from large-scale tuple indexes?
I need to find the index of some words in a string, store these indexes and, from them, perform other substitutions based on tuple indexes, which signal which words should be replaced and where they…
-
0
votes2
answers41
viewsHow to extract specific value from received message via Websocket?
I’m trying to extract the "balance" from a JSON. I would like to know how I can do this in a direct way, without receiving this complete message, which ends up being giant, but rather extract only…
-
0
votes1
answer31
viewsProblem printing code involving strings (c language)
#include <stdio.h> #define DIAS 7 typedef struct { char nome[51]; int idade; int refrigerante[7]; }Paciente; int main() { Paciente habitos; //Lendo os dados do paciente…
-
0
votes0
answers36
viewsValidation of strings in C
Good afternoon, I am learning C in college, and the following challenge has been proposed: A seller needs an algorithm that calculates the total price due for a customer. The algorithm must receive…
-
0
votes1
answer94
viewsC - How to remove a word from a String
So, I have to remove a word from a String, already add with this code: printf("Digite o nome: \n"); scanf("%s", &temporaryVector); getchar(); lettersName = strlen(temporaryVector);…
-
0
votes1
answer104
viewsWhy does my running function only return "0"?
I’m doing a function that gets a string (char str[10]) and she has to return 1 if to string contain the word "wing" and otherwise return 0. To make it easier to understand what I tried to do, I’ll…
-
0
votes1
answer54
viewsSyntax Error (Phyton)
I am doing a work here with python using Pandas/Matplotlib/Seaborn/Numpy and wanted to understand why it gave syntax error. I’m trying to modify 3 columns of my dataset if String for Date Time.…
-
0
votes0
answers162
viewsWhat is the input(). split(" ") for in python?
I’m solving some exercises in python and when I put the code this way: A = float(input("")) B = float(input("")) C = float(input("")) triangulo = float((A*C)/2) circulo = float(3.14159*(C**2))…
-
0
votes0
answers16
viewsUse of STRING_AGG in Postgresql
Good afternoon friends, I used the script below: SELECT id_docent , STRING_AGG(distinct no_municipio, ' / ') AS "Municipios" FROM public tb_uf INNER JOIN public.ts_docent ON (tb_uf.co_uf =…
stringasked 3 years, 6 months ago Cintia Costa 1 -
0
votes0
answers24
viewsGet specific value from a file
Hello, how are you? I have the following file format: username=teste1; status=ONLINE; username=teste2; status=ONLINE; username=teste3; status=OFFLINE; Where one of the lines represents the user name…
-
0
votes0
answers32
viewsremove part of a php object array
Good night. I’m trying to foreach an api response. She comes to me like this: { "page": 1, "results": [ { "adult": false, "backdrop_path": "/9WlJFhOSCPnaaSmsrv0B4zA8iUb.jpg", "genre_ids": [ 28, 27,…
-
0
votes1
answer53
viewsString array printing error // C++
I am making a force and in the printing of the drawn word, there is an error in which the words are printed with some numbers or letters not included in its scope. const int quant_palavras = 3;…
-
0
votes0
answers36
viewsHow to resolve Signal: Segmentation fault (core dumped) in C++
I’m trying to make a noose and on that part, always gives the core error dumped. how can I solve this problem? cout << newnome1 << ", ESCOLHA UMA PALAVRA: "; cin >> palavraSecreta;…
-
0
votes1
answer53
viewsHow to convert an entire string to uppercase characters without using loop?
I have the following code: #include <iostream> #include <ctype.h> using namespace std; int main() { string nome = "pedro", up; for (int n = 0 ; n != nome.length(); n++) { up +=…
-
0
votes1
answer88
viewsCount dataframe lines with string according to position in Python text
I have a dataframe with a text column, as follows: import pandas as pd df = pd.DataFrame([["1", "texto com PALAVRA frAse PARAGRAFO", True, "foo"], ["2", "texto com palavra Paragrafo", False, "foo"],…
-
0
votes1
answer42
viewsWhat kind of pointer is that?
I have the Following Code: int main() { string animal = "cabrito"; string &pn = animal; pn = "bode"; cout << animal << endl; return 0; } That generates the output: goat I was very…
-
0
votes1
answer23
viewsHow to compare a typed Jtextfield String with a randomized Imageicon in a package?
At the level of Random in a package of Imageicon of flags of countries how to compare if it was typed right the name of the flag of the country in a Jtextfield by the user? To randomize the images…