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
answer38
viewsVisual Studio C++ Strings in Hexa
I am creating a program in Visual Studio C++ with UI to do RS-232 communication with some weather cameras, for that I have to send a String in Hexa. String is sent in this format: String^ a1 =…
-
-1
votes2
answers82
viewsCreate an object reference in your own method
Problem I want to get the last digits of this string, then I used the method Substring(), however I had to use the variable "number" again within the method Substring(). string numero = "123456789";…
-
-1
votes2
answers750
viewsConvert a byte variable into a string?
Good afternoon liked to convert a byte variable into string. I have the following code; print(str.encode(frase)) which gives the following output; b'Ola' and wanted before; Ola I found a way to…
-
-1
votes1
answer743
viewsHow to insert a character at a given position of a string?
How to insert a character at a given position of a string? Ex: I have the string "abcdefg" and I want to add , before the "f" to stay "abcde,fg", how to do this?…
-
-1
votes1
answer66
viewsHelp with multiple Selenium Python Ivs
Friends, can you help me? I want to make web Scrap from a page and return all 8 texts from a span.text-Ellipsis. I made the following code: self.otherPlayers =…
-
-1
votes1
answer44
viewsHow to write multiple string (names) in R?
For example I want to write a second name nome<-c[scan("")] #insirindo uma sequencia de numeros idade<-scan() 1: 45 2: 65 3: 12 4: 32 5: 23 6: 78 7: 87 8: 98 9: 12 10: 555 11: #tecle enter…
-
-1
votes1
answer220
viewsHow can I remove all spaces from a string on a moon?
i want to pick up a string and remove the white spaces contained in it.nome = algumacoisa imagine that this is a string, I want to remove the blank spaces between the "name" and the "=" and the "="…
-
-1
votes1
answer219
viewsHow to escape the "{" character in a formatted string?
How would it be possible to make a string that uses the . format accept the use of keys as elements of the string and not escape it. Ex: I would like the variable s: interface = "alguma" s =…
-
-1
votes1
answer418
viewsHow to reverse the order of a String in Dart?
I know that in other languages have methods to get the inverse of a String and I’ve searched Dart, but I’m not finding anything. I’m doing like this: String inverter(String v) { String inverso ='';…
-
-1
votes1
answer963
viewsShuffle text
insira o código aqui[![inserir a descrição da imagem aqui][1]][1] shuffle text Rules: 1. Punctuation marks are word separators, are not part of words and so are not shuffled, for example: a)…
-
-1
votes1
answer126
viewsHow can I store token values in an array?
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <assert.h> typedef struct{ int id; char nome[20]; char telefone[9]; }tipoCliente;…
-
-1
votes1
answer45
viewsSelecting Python String List Cell
I have to select only the last sentence containing 'M6C13'. The text with all sentences in full is in this string path variable that receives the text through the CMD: path =…
-
-1
votes1
answer54
viewsProblem identifying if a word from a list is present in my string in Python
I’m looking to identify if in my input there are any words that are on a list of words that I created. The code runs normal without presenting any error, however, is missing the result always. Code:…
-
-1
votes1
answer902
viewsHow to compare a string position to a? C character
The parse_names function is not able to compare the position of the string 'a' with a letter, I want to count how many letters 'A' appear in the string and exchange the letters 'E' for a 3 .…
-
-1
votes2
answers61
viewsHow to cut a PHP string in <H2> tags
I have a recipes website where the ingredients are separated into blocks, for example: $ingredientes='<ul> <li>100g de farinha de trigo</li> <li>1 ovo</li> <li>2…
-
-1
votes1
answer127
viewsHow to include "space" on cards
I need to include spaces between the person’s title, name and surname. function cartao(titulo, nome, sobrenome) { return titulo + nome + sobrenome } The result of this is: Dr.Matheuspeixoto without…
-
-1
votes1
answer72
viewsConvert millions of STRING to INT - Javascript
I have a string 123.456.789 and when using parseint is returning 123456, how to do to return 123456789 ?
-
-1
votes1
answer58
viewsError in string formatting
I’m trying to personalize the spacing used in one string formatted, center to be very visual between the lines. The program is returning me value error. Follows the code: def titulo(msg): tam =…
-
-1
votes1
answer298
viewsDoubt about toString Java method
I would like to know the difference between using and not using the method toString in Java, because I understood that it serves as a print normal. Has some advantage in using this method ? My…
-
-1
votes1
answer82
viewsUsing the FOR command
I am developing solving issues in Language C. The question asks: A palindrome is a word or phrase that has the property that can be read from right to left and from left to right. For example, the…
-
-1
votes1
answer1327
viewsHow to convert String to Int in C++
I’m not able to convert this simple program. how do you convert? #include <string.h> #include <stdlib.h> using namespace std; int main () { int i; string a; i = atol (a); } . Error…
-
-1
votes1
answer27
viewsDynamic filename usage for file creation
I want to create files with dynamic names for storing logs, however, I have no idea how to get the name I want and also do not know how to format the string and use it with the "path/filename.txt".…
-
-1
votes1
answer30
viewsString is not being saved to a text file
I made this code whose purpose is to read any string (Maximum size 30), and to write this string in a text file. After reading the string, the program is terminated normally (No errors), but when…
-
-1
votes1
answer79
viewsRead string pointer in C
This is the question: 4. Make a program that receives from the user the size of a string and call a function to dynamically allocate this string. Then the user must inform the contents of this…
-
-1
votes2
answers225
viewsHow to initialize a string vector within a struct?
I need to start a list with names of people at the beginning of my program and I am trying to initialize the names in a string within my struct, that way: char* nomes[100] = {"gabriel" , "vanessa"};…
-
-1
votes1
answer55
viewsError reading string in C
Good afternoon people! In my program I use for reading some strings that fill a struct vector. The first reading usually occurs, but in the second reading the program skips the reading of a string,…
-
-1
votes1
answer46
viewsUse a class method from a concatenated string
Hello, I’m new to Pyhon... I have a class called Car, and in it I have a method called name that returns the name of my object. Ex.: carro_1.name() = returns the name of the car. I have the objects,…
-
-1
votes2
answers236
viewsGrab snippet of a string between () in Javascript
I have a text string in the following format: Size 35 (5 units) How can I get only the numbers inside the parentheses, ignoring everything else?
-
-1
votes2
answers745
viewsRemove characters from the middle of a String
Write a program that, starting with a word defined by you, prints on the screen the words resulting from removing, one by one, the middle characters of the previous word, until you reach a word with…
-
-1
votes1
answer816
viewsPrinting an array with all elements on the same line
Why when we ride a array, as in the following code: let x = 0 let array7 = new Array for(x = 0; x < 50; x++){ array7[x] = Math.floor(Math.random() * 50 - 10 + 10) } let array8 =…
-
-1
votes1
answer69
viewsGenerate all possible letter exchanges in a word
I need to create a function that manages all possible letter exchanges that generate words with the same sound: Palavra: Feijoada Possibilidades: Feigoada, Feyjoada, Feijoada, Feygoada But I’m not…
-
-1
votes1
answer39
viewsHow do I consider just what number a user enters in an input? (python)
rabanada = int(input("Quantos quilos você pesa? ")) if rabanada > 100000: print("Você é gordo") else: print("Você tá magro, rlx") If the user type: "100 kilos", as I do for the program consider…
-
-1
votes1
answer540
viewsOccurrence of letter in string - C
Good afternoon, My goal is to insert a string of up to 500 characters, and then read a letter. Creating, for this purpose a function that counts how many times that letter appears in the text. The…
-
-1
votes2
answers4627
viewsRemoving Characters from a String (JS)
I have a question, I need to remove a specific character of a string in my input, I used a mask to convert it into Real, but as it is with comma and point my js script is not recognizing there need…
-
-1
votes1
answer97
viewsHow to remove the string from a given range
Hello, Guys, I’m recalling programming (c++) and I took a little project to make one of a program that reads barcodes, records in a vector. Within each code read between characters 24 and 33, has a…
-
-1
votes1
answer168
viewsHow to compare two lists of names in python?
Hello, all right? So I have two lists in pdf and I would like to get the names of the people who are on both lists. How would you do this in python? It would be better in another language?…
-
-1
votes1
answer127
viewsHow to read String in the best way to use it as a halting condition of a loop?
I’m trying to ask for input to a string and read it as a halting condition of a loop but I’m not getting it. Logic Error. #include <stdio.h> #include <locale.h> #include…
-
-1
votes1
answer37
viewsHELP WITH CODE IN C, STRINGS
// what changes I have to make to make each character repeat once more than the previous one? for example: input: Roberto exit: Roobbbeeeerrrttttooooooooooo #include <stdio. h> #include…
-
-1
votes1
answer379
viewsCannot access field on a value with type ARRAY
I’m trying to pull the spine name.pt_BR that is inside the column namebut I still don’t understand how to get it specifically in Bigquery. How to pull this info to give JOIN in another query later?…
-
-1
votes2
answers128
viewsPut a variable inside a spin?
import spintax nome1 = input("Nome: ") nome2 = input("Nome: ") nome3 = input("Nome: ") for z in range(0,10): c = (spintax.spin("{noite|dia|tarde}") print("Boa {}".format(c)) I wanted to put the…
-
-1
votes1
answer71
viewsError filling a String Array: The first input line is ignored
I’m trying to solve a problem with the URI Online Judge platform: Problem 1024 and I am receiving Wrong Answer 5% (I asked here, because in the URI forum itself I did not get answers). Basically I…
-
-1
votes1
answer29
viewsconvert string to double Elasticsearch
Hello, folks are in need of a help with Elasticsearch. I’m trying to do a script conversion, from a string field, to double, but unfortunately, I’m not getting it. the last script I did was this:…
-
-1
votes2
answers26
viewsHow to return a set of elements as a single string?
I found this exercise in Code Wars where they expect to receive a single string, which will be a phone number, with the following format: "(294) 926-8617" But the best I can do is without the…
-
-1
votes2
answers31
viewsCode problem probably coming from Sqlserver
I’m trying to create a very simple login system, I’m new to programming and I’m still learning and I came across a mistake, The compiler does not present any errors however when running and trying…
-
-1
votes1
answer446
viewsStruct with string in C
I have a tremendous question, I did this algorithm here on C, I need to register patients, name, age, sex, if he’s in the risk group, if he’s with covid 19, then I need to count how many are male…
-
-1
votes2
answers446
viewsTake a string snippet between () and change it in Javascript
I have a text string in the following format: Size 35 (5 units) I need to take the numbers inside the parentheses, run a function (which is already ready) and return a new number in place. The…
-
-1
votes2
answers104
viewsConcatenate string and return the number of characters
This is what I need to do: 1 - Create a function called tamanhoNomeCompleto 2 - I received name and surname as parameter, ie two parameters 3 - This function will return the full size, counting an…
-
-1
votes1
answer75
viewsHow do I take a specific part of a string in GOLANG
I am developing a software and among its features I would like to separate a specific part of a string My code is like this so far baseURL := "https://google.com/" body, _ :=…
-
-1
votes3
answers121
viewsPython - Spaces appear out of thin air when printing print()
I have a problem with my function, I am very beginner in python so I do not understand much of the language, so I apologize if it is a very amateur mistake. When I print on the screen the result…
-
-1
votes1
answer41
viewsHow do I make a string larger than her fgets not move to the next fgets? (C)
Guys, I got these two string entries: printf("Entre com a string: "); fgets(str, sizeof(str), stdin); printf("\nEntre com o caracter a ser procurado: "); fgets(caracter, sizeof(caracter), stdin); It…