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
votes3
answers1105
viewsReading Struct Strings with Wrong Scanf
Good guys, I am developing a C code that performs data registration in files. However, I have a problem in the function register, which you will see below among the codes. Struct of the client:…
-
0
votes1
answer104
viewsHow do I print Side using end=" with the included Time Module
import time for i in range(0,10,+1): print(".", end="") time.sleep(1) I want to know how to print . sideways ex: ... During that time of 1 second... when I don’t use the end it works but printing…
-
0
votes0
answers147
viewsIn C, how to compare a string obtained from Strtok to another string
Well, folks, in my progress in C language study, I’m working with file manipulation, nothing too complicated, but I’ve come up with a problem I can’t solve, For lack of more definition in searches…
-
0
votes1
answer224
views -
0
votes1
answer94
viewsFetch content from an online file
string nome, idade, valores; WebClient WEBC = new WebClient(); public void Exemplo() { valores = WEBC.DownloadString("https://pastebin.com/raw/r4GjhKQ3"); } I want to take the values of the name and…
-
0
votes2
answers220
viewsItem within comment in PHP
If the "@Return string" inside the encoding of a PHP file is deleted, will the encoding suffer significant changes? I can delete all comments including "@Return string"? And lastly, why did he turn…
-
0
votes1
answer31
viewsphp method that checks two strings in a variable
Does anyone know any method in PHP that matches the value of a variable with string? I need to refactor the following code: public function hasPlan() : bool { return $this->reference === 'unico'…
-
0
votes1
answer263
viewsHow to change a string name
I’m asking a question in Rio Tag replacement, that one has to replace one name with another but I’m not succeeding, I can only with normal names without characters My code #include <stdio.h>…
-
0
votes1
answer125
viewsRead text file and store fields in variables
I need help on the following: I will do a b-tree to present a work at the college, which consists of reading the data from a text file and passing them to the B Tree. I will do as follows: I created…
-
0
votes1
answer13099
views3-letter abbreviation table for cities by state
In the State of SP for example ADA would be Adamantine, ADO Adolfo, AGU Aguai, AGD High, ..., ADC, Alvaro de Carvalho, ABR Americo Brasiliense, ... SJC Sao Jose dos Campos, ... but "could be" is…
stringasked 6 years, 5 months ago Peter Krauss 1,830 -
0
votes2
answers60
viewsHow can I check if within one string there are others?
In javascript, I want to check if in a string there is at least one of the following strings: . com, . edu, . br, etc... if one of these strings exists in the main string, I want it to come back…
-
0
votes4
answers2757
viewsHow to catch last word of a string in PHP?
For example: "JOHN DOE OF SUCH". I wish to take only the word "SUCH".
-
0
votes1
answer31
viewsHow to make a request and search for a string
I wonder how I give a request and look for a string, example: *www.site.com/index.php? id=' (Error SQL) (find the error) I’m just having trouble with it since it’s almost all set, so follow the…
-
0
votes2
answers1096
viewsHow to count how many substrings you have in a C string?
https://www.urionlinejudge.com.br/judge/pt/problems/view/2126 This exercise I thought better read as string or not... #include <stdio.h> int main(void) { char N1,quantidadesdeN1;…
-
0
votes1
answer186
viewsProblem splitting a String array into C
I’m making a program that needs you to find half a string vector, but that half cannot cut any word, so that half would necessarily have to be the next space found after half. Soon after finding…
-
0
votes1
answer43
viewsReplace Line in string
I’m creating a C# application using Replace(), i can replace a specific word by another in the entire file, but I wonder if there is a way to do this replace in just one specific line. I want the…
-
0
votes2
answers217
viewsDefault list replacement in regex
People need to turn a string into a list, in a peculiar way. I found in this post what I need to do. But I’m lost on the regex applied. I have numerous string in the following format: ["DECRETO Nº…
-
0
votes1
answer384
viewsHow to handle reserved character in a . ini file in php?
I have a file .ini where I keep some information outside the directory tree of the site, it happens that in a password I have special characters. The moment php picks up this content it gives…
-
0
votes2
answers1690
viewsChange Python string
I’m making a program to sort the numbers entered (I can’t just use a sort algorithm), searching saw that it is not possible to change strings in python, is there any way to do this? Or maybe use…
-
0
votes3
answers117
viewsText looks full of junk after typed
I started creating a data collection and usage application with the following code: #include <stdio.h> #include <string.h> int main() { int idade = 0; char nome[20]; printf("Hello! How…
-
0
votes1
answer549
views -
0
votes2
answers446
viewsHow to pick up snippets between () a string
I’m doing a program that reads some mathematical expression like for example x^(3*x+1) + (cos x), it doesn’t necessarily have to be that expression, and I’d like to know how to get the specific…
-
0
votes0
answers103
viewsString vector condition error in C
I’m having a hard time with a specific exercise: #include <stdio.h> #include <stdlib.h> #include <locale.h> #include <windows.h> #include <ctype.h> #include…
-
0
votes0
answers66
viewsWhen printing string, meaningless characters are shown
I need to do a program that calculates the average salary of a company, asking the user for the amount of employees, the name and salary of each employee and returning the average, the name of the…
-
0
votes1
answer40
viewsNslocalizedstring does not recognize Localizable strings.strings
Next I’m trying to use Swift’s string localization system, but apparently it doesn’t recognize the strings, for example instead of appearing the string Start appears txtinicio, I’m trying to access…
-
0
votes1
answer704
views(C) Make an algorithm that reads a string and removes vowels and whitespace
The code is copying ALL characters from one string to the other and ignoring the copy condition. I know there is an easier way to remove spaces and vowels, which is to bring the next character to…
-
0
votes1
answer1271
viewsSaves float array in a txt file
After saving array in txt I want to be able to work with each of the values doing all the mathematical manipulations, but the way q I am saving I am not getting. Someone can help me. import numpy as…
-
0
votes2
answers321
viewsHow to place an integer at the end of a string?
I need to loop up n placing an integer at the end of a string. Ex: string "E0" and an integer of 0 to n, getting something like this: E00, E02, E03, ... , E0n char ent[3] = {'E','0'}; char a[1]; int…
-
0
votes1
answer23
viewsGenerate array with substring positions
There’s some way I can pick up a string, like, "John went to the bar last night". Generate an array that stores the position of all " of that string. I will use this to put in these positions for…
-
0
votes1
answer138
viewsPython set String where the cursor is
Good afternoon I need to set a string where the cursor is stopped. Examples are: - Blinking cursor stopped in a notepad, play a string in the notepad. - Blinking cursor stopped in any input field,…
-
0
votes1
answer148
views -
0
votes1
answer99
viewsCreating strings with special characters
I am making a clock simulator program. However, when printing the result, I am having errors. Here’s how I do it: float abc = 1:00 + 2:00 ; printf("horario: %f",abc); How do I then make and print a…
-
0
votes0
answers50
viewsSort strings on a struct array in C
I’m trying to sort alphabetically strings in a string array in a struct, but for some reason the names get bugged #define TV 10 #define TC 100 typedef struct ficha { char nome[TC]; int dependentes;…
-
0
votes1
answer63
viewsHow to play letter by letter of a sentence in an array?
Example: in the sentence naruto, the letter n vector frase is in position frase[0]. I want to put it on mat_cript position [0][0]. Not only her, the rest of the sentence too. #include…
-
0
votes0
answers1602
viewsLine break inside string that is inside a string template
I know that to break lines inside string, we use the operator \n. I also know that within template strings, we can do it using only the backslash, this way. var string = `Uma linha \ duas linhas \…
-
0
votes0
answers43
viewsString splitting
Being a string in the following format: string valores = "valor1#valor2#valor3"; I wish to store the values separated by # in a array, having such a result: teste[0] = valor1; teste[1] = valor2;…
-
0
votes1
answer37
viewsMy script looking for a string in another string is taking too long
My script loads the command1(file1) and saves the first column of all rows in an array, later it will search for each substring of that array in a 2(from command2) file. The problem is that file 1…
-
0
votes2
answers115
viewstransform string into multidimensional array
I have the string down and I’ve tried to turn it into a Multidimensional array but I don’t know how to do it, another problem I can’t solve is the spaces, even using a explode they remain in the…
-
0
votes1
answer252
viewsConditionals in xml
I’m working on a arquivo.xml and I need to declare a property if the string I receive as parameter nay be empty. <condition> <property name="SHAZAM" value="Esse é o conteúdo…
-
0
votes1
answer83
views"strcpy" behaving strangely depending on how you put it in "if"
What’s going on here? #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> void escolha_simb(char *jog1, char *jog2) //** escolhe quem vai ser x ou o…
-
0
votes1
answer55
viewsBest way to perform print command
I’ve been studying about Python for a short time and I’ve learned to display a print value in three ways: % '{}'.format(exemplo) f' {exemplo} ' There is one more way pythonic or each form is…
-
0
votes1
answer446
viewsPowershell (new-Object System.Net.Webclient). Downloadfile Strings as Arguments
I have the following code that I use to download the last chromedriver for a specific folder: (new-object…
-
0
votes1
answer244
viewsStore the contents of a file in another - python file
I’m trying to read information from a file and save it in a new file, after passing all information to lowercase and removing punctuation characters. For this I created a Readfile() function that…
-
0
votes2
answers58
viewsConcatenate n characters of a typed word
I want to make a program in which the user type any word and is stored in a string, soon after it is necessary to store that same word in another string only in the reverse form, for example if it…
-
0
votes1
answer31
viewsWrite word in succession until the end of the cycle
let palavra="1234567";; let tamanho=String.length palavra;; for i = 0 to 6 do print_string String.sub palavra i (tamanho-i); print_string "\n"; done;; I tried to execute the code, but it won’t…
-
0
votes4
answers460
viewsHow do you separate word into letters in php?
I want to separate a string that has no separation in an array example $s = "123"; $array=["1","2","3"]; I tried to use it as follows valores = (array) explode("",$IdNota); but he gives Warning:…
-
0
votes1
answer1682
viewsCheck if a letter exists in the c++ string
I’m having problems in my function that checks the existence of a specific letter in a string (I don’t know much about pointers I only used because my other function wasn’t returning the string if…
-
0
votes0
answers39
viewsProblem with string value
I’m using a Microsofot Graph API to get some data and I need to use one of the values it returns to me to do an UPDATE. The problem is that the returned value has quotes and bars. Through GRAPH…
-
0
votes0
answers72
viewsProblem with serial reading
Guys, I’m trying to read data from a serial port in c#, but along with the data is being returned too "junk", which makes it impossible to convert the string to integer. Is there any way to make me…
-
0
votes1
answer59
viewsI’m having trouble printing a variable in my program
I’m doing a program that simulates a bank, in function criarpessoafisica I’m trying to get the algorithm to check that Cpf is already registered, but it’s not working ! For some reason he printed…