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
votes4
answers2571
viewsNumber of vowels in the Python function
I want to do a function in Python that makes a count of how many vowels there are in a string in which the user type. My code: def cacavogais(): i = 0 j = 0 string = str (input("Digite alguma coisa:…
-
0
votes1
answer55
viewsDoubt regarding string manipulation
I’m starting programming and was trying to do a string manipulation, someone could help me in the code below where I would be missing: #include <stdio.h> int main( int, char ** ) { char nome[]…
-
0
votes1
answer108
viewshow to pass char from the main int to a class c++?
I’m struggling with how to pass a char type variable from the int main and play to a variable in the class. Example of the way I’m trying: class Nome{ private: char n[50]; public: void set_nome();…
-
0
votes1
answer72
viewsPick string value from txt
I have in a txt that is mirror of a tax printer, I would like to take the COO number corresponding only to Z REDUCTION, in the example below would like to catch only the value 031717. 02/01/2014…
-
0
votes2
answers552
viewsChanging character values in C
I’m trying to change the value of the characters by adding the current value plus some value provided by the user: char texto[7] = "barfoo"; int tamanho = strlen(texto); for(int i = 0; i <…
-
0
votes2
answers99
viewsdoubt string/map c++
Good afternoon! I’m answering a programming list, the question is very easy and I know the logic of execution but there is a part that I do not know how to implement, I left it in italic. Make a…
-
0
votes1
answer235
viewsDid inverted string quote support appear in Ecmascript 6?
Inverted quotes used in strings like `exemplo` were added to Ecmascript 6? I wonder if this came up in this version. PS: I don’t believe the question is duplicated, because my question is whether…
-
0
votes2
answers243
viewsConvert VB code to C# which turns characters into numbers
I have this code in VB and need to convert to C#. Public Function eNumero(s As String) As Boolean If s = "" Then eNumero = False Else eNumero = Asc(s) >= Asc("0") And Asc(s) <= Asc("9") End If…
-
0
votes1
answer506
viewsC string array
I know that to define a word (string) in C, it is necessary to use a vector of characters, with a defined number of characters that will be used. However, how can I use a multi-word vector, that is,…
-
0
votes1
answer957
viewsDoubt in exercise in C - reading with fgets
Good evening, I am learning C language through Luis Damas' book. There is an exercise of it that the program is not ending in condition. I’m using linux so I had to change the function gets() for…
-
0
votes1
answer24
views -
0
votes2
answers87
viewsString scanf() time problem
I wanted a help in solving the problem of a string, because when you read the program automatically from as invalid option any option, so you do not use the option I chose. No if I’ve tried with…
-
0
votes1
answer610
viewsHow to collect snippets of a text with the Pageobject object from the Pypdf2 library?
Going remove a section of text of a PDF with the library PyPDF2 in Python. Precise find the word "Lc" inside the PDF and extract it: the word "Lc", which means leasing, comes accompanied by a number…
-
0
votes1
answer61
viewsAn alternative to Strings?
Several things in the project have a table with possible names (strings). But I don’t want to use strings to make comparisons for various reasons (case-sensitive, typo, name table changes, etc). So…
-
0
votes0
answers42
viewsInform two totals of different hours and have as output the amount of hours between the two informed
In this problem I cannot use any ready lib!!!!! So, in Python 3, I must do what is asked, however, I’m having difficulties to implement this, until then I tried to calculate the differences of the…
-
0
votes1
answer142
viewsTotal count of characters without strlen
I need to count the total number of characters present in any word without the function strlen(). First I performed the word reading, after using a for to go through the word, within the for I used…
-
0
votes1
answer86
viewsError including image with <img .../> tag by string in PHP
I cannot make a referenced image in the code below appear. What may be the problem? <style> table{width: 100%;$borda;$fonte;} th{text-align: center;} td{text-align: center;$tam_etiq} tr{ }…
-
0
votes1
answer260
viewsFalse return when comparing two python identical strings
I’m trying to compare two strings, one comes from the database as an array, the other is written by hand: string = str(profile[1]) #Carlos Gimenes print(string == str('Carlos Gimenes')) #Retorna…
-
0
votes1
answer193
viewsManipulating String while true PYTHON
I’m doing a student grade exercise, receiving a str with the student’s name, then int to know the grades(n1,N2,N3,N4). I made a while true, so it will always ask, until the user asks to quit,…
-
0
votes1
answer101
viewsBizarre error with dynamic allocation
I wrote this simple program: #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char *nome; nome = (char *)malloc(10 * sizeof(char)); if(nome == NULL) {…
-
0
votes1
answer51
viewsAndroid - Convert arrayList to String []
Good morning guys, I need to convert a ArrayList for a String[]. I could not make it work. Just returns me a giant string. Follow my code public List<Item> geral(){ buscaLatLong();…
-
0
votes1
answer43
viewsString conversion problems reading data in CSV
Personal greetings. I’m creating a program that reads data from a csv file. I’m having trouble reading a String and converting to int, because in the String reading is not removed the quotes ("").…
-
0
votes1
answer456
viewsApply a regex to the result of a select
I am making a query to get all the projects that are being executed: SELECT p.id FROM projetos p WHERE p.status LIKE 'Execução' An example of the result: COD00012347 COD00012348 COD01212349…
-
0
votes1
answer98
viewsWhile finds no match, C language
I have the following code in C: #include <stdio.h> #include <stdlib.h> #include <locale.h> struct crPlayList{ char music[120], singer[120]; float mustime; struct crPlayList *next;…
-
0
votes1
answer265
viewsJava - How to access a String vector of a Class in another Class?
Hello, I have a class called File.java, in which I read a txt file and put the phrases contained in this file in an Arraylist, which can be viewed in the code below: public void leitor() throws…
-
0
votes1
answer139
viewsHow to use Join in an object list?
class Pessoa: def __init__(self, nome, idade): self.nome = nome self.idade = idade p1 = Pessoa('João', 15) p2 = Pessoa('Maria', 17) lista_pessoas = [p1, p2] How to use the join() to print the list…
-
0
votes1
answer1296
viewsHow to check if a character is uppercase or lowercase in Pyhton?
I have a string any and I need to know the amount of upper and lower case letters in that string. I started sketching something like this: def contaMaiuscula(string): ma = 0 mi = 0 for c in string:…
-
0
votes1
answer56
viewsSeparate string data from a table into other tables
Good morning, I have a table called TP_SAN_SRV, which is the table that has the blood type and blood factor, but I need to separate them in two, where the blood type and blood factor are separated.…
-
0
votes2
answers71
viewscut DNA nucleotide string
Could someone help me in this matter: I have a nucleotide sequence (letters: A,T,C,G), need to remove part of this sequence and leave only nine nucleotides starting with ATG and ending with TAA...…
-
0
votes2
answers521
viewsConvert from String to Integer in Pascal
Good evening, I have a problem in Pascal, I take a variable in String, the variable would be a Hexadecimal, I need to convert this String to integer and do not know how to do. Thank you program…
-
0
votes2
answers820
viewsC program does not correctly read a . txt file with integer numbers
I’m with this C code where the goal is to read 25 whole numbers of a text file and store them in a 5 by 5 array. The problem is that when running on MS-DOS, the program prints only junk from memory.…
-
0
votes1
answer267
viewsError using Lower(), upper() and title() functions
I have the following problem, when trying to use the functions lower(), title() and upper(). My compiler simply won’t allow and displays the error AttributeError:'list' object has no…
-
0
votes3
answers189
viewsFunction to print the number of characters in a two-dimensional string
By the enunciation of the exercise, I must use as the second argument char **strings, I believe that there is my confusion, in manipulating her to count the size of string. (I did other tests with…
-
0
votes1
answer73
views -
0
votes2
answers74
viewsScanf does not close the read
I am trying to make a program where it receives a char matrix and at the end prints the new matrix. #include <stdio.h> int main(){ int l,c,i,j; scanf("%d %d",&l,&c); char…
-
0
votes1
answer84
viewsString comparison
Is there any way I can find a specific letter in the string to enter this if of the special or normal account?? /*As contas dos clientes de um banco podem ser divididas em contas “Comum” e…
-
0
votes2
answers86
viewsString problem in C, term exclusion in string, through string comparison
I wrote a code that excluded the similar term in both strings, but it does not print the result of the text by taking the second term, it only removes the first term from the first string. "Create a…
-
0
votes1
answer95
viewsOperator ">" cannot be used comparing strings
import java.util.Scanner; public class ordenarNomes{ public static void main(String[] args) { Scanner in = new Scanner(System.in); String [] nomes = new String [20]; for(int…
-
0
votes1
answer47
viewsError mounting String with parameter . NET
So guys, I’m developing a project with . NET Core Razor, and I’m assembling a string there, as follows: string TotalInformacoes = ""; TotalInformacoes += (!String.IsNullOrEmpty(cl_1.Trim()) ?…
-
0
votes2
answers374
viewsBreaking string from a character
Inside my dataframe, one of the columns has information separated by comma, I would like to delete everything within the string after the first comma. Follow the code I’m trying to use: df_movies =…
-
0
votes1
answer221
viewsQuestions about the use of C functions
I need to do an exercise that will basically ask the user to type two strings. Before that, an integer value X is entered representing the position from which the first string will be saved to the…
-
0
votes1
answer76
viewsHow does a car class in Java convert to C++?
public class Carro { private String nome; private int ano; private String modelo; private String marca; private String combustivel; private Double valor; public String getNome() { return nome; }…
-
0
votes0
answers38
viewsC-Reading a specific amount of characters
Hey there, guys! I’m just a beginner in the programming world and I’m facing the following problem: I would like to read the name of a player that must have at least 1 and at most 10 characters, at…
-
0
votes0
answers47
viewsProblem with flag or string?
In this simple code the program should exit the loop when I type the word quit. msg = 'Que lugar gostaria de visitar?' active = True while active == True: Here the input is assigned to place and…
-
0
votes1
answer83
viewsError in python exec command
I’m trying to accomplish an action through command exec(): import asyncio from pyppeteer import launch async def main(a): #função que executará o comando exec(a) c="""browser = await launch()…
-
0
votes1
answer1138
viewsC++ code error with getline(Cin,string)
I’m learning to program in C++ and when I use the getline function(Cin,name) I can’t put text in there and the Avanca code for the next line. The program should ask for age and name and is supposed…
-
0
votes0
answers101
viewsConvert integer to string in C
I have a problem with converting an integer to string in the scope of a function where the conversion return is given as null and I don’t know why. #include <stdio.h> char *getTexto(int num) {…
-
0
votes2
answers476
viewsI need to return the text of a m3u file in lists
I have a file ". m3u" I need to return some data in list. PHP example: <?php $m3u_file = file_get_contents('meuarquivo.m3u');…
-
0
votes1
answer54
viewsError in variable type
What fix do I have to make this code run without error? #include <iostream> using namespace std; int main(int argc, char** argv) { int anoNasc, idade, anoAtual = 2020; char categoria; cout…
-
0
votes1
answer388
viewsMultiply even index values of a string in C
The question I need to solve is the following: The person gives a number, I need to multiply by 2 all the numbers that are in the "index" even, the problem is that the index starts at 1 on the…