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
votes3
answers2089
viewsGet the site name in the javascript url
Guys, I got this: I can have the following situations from a url: www.exemplo.com.br or http://exemplo.com.br or http://www.exemplo.com.br and also with HTTPS. I would like to take only the word…
-
1
votes3
answers1521
viewsCannot implicitly Convert type 'string' to 'int'
protected void btnSave_Click(object sender, EventArgs e) { List<ProdutoAmortizacaoCreditoDias> aDay = new List<ProdutoAmortizacaoCreditoDias>(); ProdutoAmortizacaoCreditoDias ee = new…
-
1
votes3
answers1980
viewsHow to find a letter in a string?
How can I test if a letter (stored in a variable) is contained in a word? ex: palavra = "palavra" escolha = "a" output The word has 3 letters "a" in the word.... or…
-
1
votes1
answer53
viewsAbout String Handling
I have a somewhat curious problem, perhaps a challenge. I need to add to my database the list of all cities in Brazil, I found an SQL with all the way I need, however, the name of the SQL table…
-
1
votes1
answer223
viewsProgram does not wait to read the received content
I’m creating a program that reads the student’s name, number of fouls, 3 grades and returns if the student has passed, flunked for foul or flunked for average, knowing that the foul limit is 15, the…
-
1
votes1
answer1179
viewsHow do I sort string in the Insertion Sort method?
I’m with the following method, but in the WHILE line it’s error. netbeans says "bad operand types for Binary Operator "&&", first type: Boolean, Second type: int". public boolean…
-
1
votes1
answer65
viewsBackstroke, backstroke, backstroke
hello. I have been trying to find out if I can reverse a path? How can I reverse a path and then go on as normal? for example I need to revert a path to this string ( LPCWSTR path = ) so I need to…
-
1
votes1
answer56
viewsString equivalent using variables - Python 3.x
What would be the string equivalent : values = """ { "exchange_code": "PLNX", "exchange_market": "BTC/USDT" } """ Which the result is : '\n { n "exchange_code": "PLNX", n "exchange_market":…
-
1
votes1
answer315
viewsDoubt on how to use Shift in Java
Well, I have a question about how to use Shift Left in java. I have a String representing a hexadecimal value. Only I need to pass this value to binary. For this I use an integer variable to turn…
-
1
votes3
answers2111
viewsComparing C string contents to find palindrome
I need to check whether a string The, for example, is equal to string B to determine if the word inserted is a palindrome, the problem is that a string B is the reverse of A, I’m not able to…
-
1
votes0
answers34
viewsWhat is string interpolation?
Good night! I’m learning c#, and my teacher talked about string interpolation, only I don’t understand what that is. Could you explain to me?
-
1
votes2
answers72
viewsHow to decode a code that modifies vowels
I am trying to create a code that modifies vowels. As an example of an input would be: 2n1v5rs0 5 t2d0 0 q25 5x1st5 f1s1c4m5nt5, 1ncl21nd0 t0d0s 0s ... and the exit would be: universe and everything…
-
1
votes1
answer78
viewsProblem in understanding this structure in a python string
I was studying file compression when I came across the following script: import sys import os.path import bz2 import zlib import base64…
-
1
votes1
answer395
viewsC# String.Contains() does not work, not even string search derivatives
I have a method in my code that looks for a person’s name inside a string but always returns false. Even when the name exists inside the string. What is totally inexplicable. I tried using Contains…
-
1
votes1
answer2823
viewsVBA: Putting a space before or after uppercase letters in a given text
I have a string of texts that represent customer names, but which are without the proper spacing between each word/name (for example: Carlosalbertogomes). However the words can be differentiated…
-
1
votes2
answers4092
viewsHow to convert a list to string and vice versa?
I have a list: ('47075', 'josenestle', 'i need help') I do str1 = str(list) and have it in string. However if you do list(str1) I do not recover my list. I find no obvious solution, help would be…
-
1
votes1
answer131
viewsConvert strings to boolean
I’m dynamically adding one javascript and its src need to pass some parameters... the following function creates this "querystring": var querystring = {a:'b',b:true,c:'d',e:false}; var query =…
-
1
votes1
answer5263
viewsString chained list (character array) in C
I’m doing a job for college, and it’s basically about hash table. At work, I have to do a Hash table of a n strings, for example. Instead of making an array of characters (in this case, an array of…
-
1
votes2
answers897
viewsHow to delete an element from an Array String?
I’m having the following build error: del(alimentos[i]) TypeError: 'str' object doesn't support item deletion What did I do wrong? I would like to remove the typed item from the list. My code: dieta…
-
1
votes1
answer393
viewsCopying strings in C
I would like a help on the following question: I have a char with a text of 32 characters, so I would like to know how to separate this char in two of 16 characters. Type: char textao[32] = "Oi meu…
-
1
votes3
answers843
viewsHow to extract a specific text from a string via Javascript
Question related to how to remove only part of the text that is after my tags p: and r: I am developing an application similar to chatbot simsimi and for test questions I am storing the questions…
-
1
votes1
answer303
viewsError when comparing an Edittext to a String
I am trying to compare the text inserted in an Edittext with an item in my Arraylist, but the condition is never true. int aux=-1; for (int i = 0; i < lista2.size(); i++) { if…
-
1
votes1
answer361
viewssystem() does not accept string type variable in c++
In order to automate some backups that need to be done routinely, so I thought of using an dos to do, but I’m having trouble compiling the executable because it seems to me that the function…
-
1
votes2
answers1288
viewsTurn string into integer in PHP
I have two classes communicating. One of them returns a getter with the month typed in the form, and the other class receives this getter within the cal_days_in_month() function. The problem is that…
-
1
votes1
answer180
viewsProblems scanning strings within the switch (C) command
I’m trying to make a program that encodes and decodes strings that are given by the user by the César cipher method, using switch-case to select what should be done, but when trying to read a string…
-
1
votes1
answer332
viewsReplace and Preg_match when using one or the other?
Doubts about the functions substr e preg_match/preg_match_all. When will I use one or the other? Both remove parts of the texts, only preg_match withdraw through correct regular expressions? Could…
-
1
votes0
answers32
viewsCan I pass a string, which is not previously stored in an array, as a parameter for a function?
I wrote this function to remove the characters nay repeated from any string in c: char *repeticoes(char *s){ int i=0, j, cont=0; while(s[i]!='\0'){ for(j=0;j<strlen(s);j++) if(s[j]==s[i] &…
-
1
votes1
answer265
viewsHow to split the string after counting 50 characters
I have to count 50 characters and make a split in two variables. The ideal would be to split the last space before 50 characters. This is to be able to put the address in two lines in the database.…
-
1
votes1
answer717
viewsProblem with char returning strange characters
The intention is to replace all words toda for 0, however after X characters it starts returning strange values as can be observed in the comments. I think I’m handling the parameters wrong, but at…
-
1
votes2
answers463
viewsSeparate string variables json
I have the following string: string(292) " {"access_token":"ab5f49438xfbc2df2a6a927a02b5c2e2442am982c71ee8re4aee1b2c64783ddc7cab4050ed05d6aa", "token_type":"Bearer", "expires_in":300,…
-
1
votes3
answers2758
viewsHow to print without line break in Python
matriz = [] def create_matriz(a, b): for contador in range(a): matriz.append( [0] * b ) def print_matriz(txt): cont = 0 for j in range(a): for i in range(b): if txt[cont] == "0": matriz[i][j] = 0…
-
1
votes2
answers233
viewsproblems with string and split C#
I have the following function: string str = "1 2 3 4 5"; //string para separar string[] ArrayValor = str.Split(" "); //nesse caso o array seria {"1","2","3","4","5"} but wanted something more…
-
1
votes1
answer1218
viewsHow to put " in a String?
I’m trying to evaluate a PHP code using Java, for that I need to replace in the code all " for \". The problem is that Java also has this escape character to put " in a String. Told me to use \\",…
-
1
votes2
answers7350
viewserror when conver string to float in python
Hello I’m having a problem I’m not getting Contact string to float the program takes the price of a dps game converts to string and position through the character and I am unable to convert price…
-
1
votes1
answer423
viewsImplementing Regular expression in Java
I need to make a program that reads a file and can count how many classes and methods there are. The reading and separation part by line I have done, I need to identify class and method. I am…
-
1
votes2
answers9247
viewsHow to check if one string is contained in another in C?
I have two variables: char s1[20]; char s2[20]; I’ll go get the input user of the two variables, and after this, I need to check whether s1 is contained in s2, even a part of it. For this I will use…
-
1
votes2
answers1485
viewsProblems with function that returns character array in C++
Follows the code: #include <iostream> char* criaVetor(){ char vetor[20]="Olá mundo!"; return vetor; } int main(){ char retorno[20]=criaVetor; std::cout << retorno; return 0; } error:…
-
1
votes1
answer148
viewsInsert character by character of the Russian alphabet into a char vector in C++
Hello I would like to know how to insert characters (of the manual form) of the Russian alphabet in a char vector, because I am trying the form below and the problems in the press. Follows the code:…
-
1
votes2
answers67
viewsString reading
char nome[100], endereco[100], sexo[100]; printf("Digite seu nome: "); scanf("%[^\n]s", nome); printf("Digite seu endereço: "); scanf("%[^\n]s", endereco); printf("Qual seu sexo: ");…
-
1
votes3
answers64
viewsDelete part of a string and keep URL contained in it
Inside a string there is a snippet used by Wordpress to display the image in the middle of a news, it is possible I remove all this stretch of the string and take advantage of the image URL?…
-
1
votes2
answers3664
viewsWhat is string ISO-8859-1?
I need to use utf8_decode and PHP utf8_encode, then I saw something about ISO-8859-1 string. What would that be? I do not want to know how to use, at the moment, I just want to know the meaning of…
-
1
votes2
answers994
viewsHow to read Console strings?
I’m trying to make a code that reads a string from Console browser and assign the string value in id "txtTextoResposta". To make it more illustrated, I want to make it similar to C#, when we do like…
-
1
votes0
answers61
viewsArray vector has "n" elements, but lenght returns "n+1" in C
Hello, I have the following question: I have a vector and I’m sure it is passed to him only one element through the following loop: char uid[1]; while(indice1 < indice2){ printf("Valor de indice…
-
1
votes2
answers88
viewsOrganize string data flow by default
Friends, I am working on a scraping project. At some point, I capture a table on the screen in the shape of a giant string, more or less like this: list = ('0004434-48.2010 n EU n (30 working days)…
-
1
votes2
answers1520
viewsParameter in bold C#
I have the following string: string frase = string.Format("A data de hoje é: {0}", DateTime.Now.Date); Is there any way to make the parameter bold?
-
1
votes2
answers726
viewsHow to read numbers from a txt file in C#?
This is an example file: 2 0.03159527 0.1990048 0.9794891 0.02173799 0.9969404 0.07508247 The first number indicates how many lines are, for each line are always three numbers I tried to do…
-
1
votes2
answers590
viewsSeparating Sentences in a String
I have this String with a space between the title (uppercase) and the description: THE CASE BACK TO DISTRIBUTOR Drop again The code: final String linha =…
-
1
votes2
answers135
viewsWhy only an Encoding works in the algorithm?
Here’s the deal: I have an encryption module that encrypts a byte[] and out another byte[] encrypted, and at the end of the output a checksum is placed; the checksum is a single byte generated by…
-
1
votes1
answer159
viewsc# delete Drawstring in picturebox
I have a pictureBox where the user with each mouse click inserts a text on top of an image in a pictureBox. It inserts several texts at various points in the image, the inserted text is taken from…
-
1
votes2
answers990
viewsRemove data from within a String
In java I am reading several lines of an HTML file and in it I have to remove some data and store in variables. And to remove this data I have to remove some tags and data that are within certain…