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
votes1
answer312
viewsString help
Make a program that finds the set of 5 consecutive digits in the sequence of only numeric characters that generates the largest product, print that set of 5 digits and the result of your product.…
-
0
votes1
answer244
viewsCounting Numbers using Array in C
How to count integers using a C array in this model: Input > two strings with "integers" ex: 8 15 Output > A string with range numbers, inclusive: ex: 8 9 10 11 12 13 14 15. Probably a basic…
-
0
votes3
answers9343
viewsCheck if a date is valid
I’m getting a date in format: string: "01/03/2010 23:00" How can I verify that this date is valid? By validity, disregard questions of days or months being with wrong numbers. The validation would…
-
0
votes2
answers714
viewsSeparating substrings and storing in C++ variables
So I created a function that reads a text file and stores, line by line, in a string array by removing commas. The file entry is : add $t2, $t3, $t4 sub $t5, $t6, $t7 addi $t6, $t7, 4 Applying the…
-
0
votes2
answers111
viewsIs it right to use string when the value is integer?
Today I came across a certain situation that left me in doubt: In my application I have some ID's from a table, these ID's are integer values (1,2,3, and so on) and I treat them all as string. One…
-
0
votes0
answers44
viewsFind char in a string, never find
I made a function search for a character in a string. The input parameters are the string and the character. The function returns 1 (one) if the character exists in the string or zero otherwise. The…
-
0
votes1
answer184
viewsHow to delete the first and last name of a string
Original: string nome = "João da Conceição Lopes"; Expected result: string nomesDoMeio = "da Conceição";
-
0
votes1
answer606
viewsHow to concatenate html tag in php?
$t ='<span style=\"color:#FF0000;\"> '; $t. "texto '</span>' "; echo $t; The code above does not work, nothing is printed. I believe the problem is the closure of tag span. How to solve?…
-
0
votes1
answer438
views -
0
votes1
answer165
viewsHow to replace a string letter when it is masked?
I’m creating a hangman’s game for further learning of programming logic. 1- I masked the textfield with *** so that the user cannot see the word. 2- In my example, I created 3 buttons, being…
-
0
votes1
answer566
viewsHow to write about an image
I found this code on the Internet and made some changes, but I’m not sure what’s going wrong. Code: public class main { public static void main(String[] args) throws IOException { String key =…
-
0
votes0
answers57
viewsExecute string code in C#
I’m a C# beginner and I built a code inside a string and I need it to be executed. string MyString = "MyPictureBox.BackColor = Color.Red;"; I have found other similar questions (including apologies…
-
0
votes1
answer241
viewsHow to catch the line below (next line) in C?
Good morning people, I have a file that contains several lines, among them the following: REMARK Evaluations: CoarseFF Proper-dihedrals Coarse Atomic Repulsion Coarse Compaktr Hbond_Strands…
-
0
votes1
answer1064
viewsHow to create date file in iso string in name?
I’m having trouble creating a file with the following template: 2017-01-17T09:42:15.3419026-02:00_teste.txt When I run the application to create appears this message: No support for the given path…
-
0
votes1
answer71
viewsPHP - Get variable values in string
I’m new in Wordpress and PHP and I’m having a little problem rsrs I have a very large string that I get dynamically. This string is actually an array of various values and variables. I would like to…
-
0
votes2
answers4111
viewsCopy string from a given character
I am developing a C program that will work with 02 files .txt The first file, is a report, that goes straight out of the system, and in it are information like item code, location and quantity in…
-
0
votes2
answers549
viewsRemoving replaceAll("[().- "]")
I’m using the openJDK1.7, I’m in need of help. String[] vetor = {"\"Jui.ce \"", "j-90.0", "Abobr.e-u"}; for(int = 0; i < vetor.length; i++) vetor[i].replaceAll("[()-.\"]", ""); The above code…
-
0
votes1
answer678
viewsHow to convert a string to an integer in a socket program?
Here is an excerpt from the code: def CriarServer(self): Host = self.Txt1.get() Port = self.Txt2.get() sockobj = socket(AF_INET, SOCK_STREAM) #Erro sockobj.bind((Host, Port)) sockobj.listen(5) while…
-
0
votes0
answers33
viewsCan you turn a literal string into a variable?
I searched the web, but I didn’t see how to turn a simple string into a variable, I saw parse_str but it’s not quite what I need. I want the following, I have the string "userName 1", and I would…
-
0
votes0
answers63
viewsHelp in Binding C#
I have this following code: private void DataGrid_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { var i = 0; var d = DataContext as TicketExplorerViewModel; if (d == null)…
-
0
votes3
answers2541
viewsTaking String values from Arraylist<Object>
I take all my values from the database and put them in one array list<object> i would like to know how to access the value within this arraylist emu, for example TesteLinhas.get(0).toString()…
-
0
votes3
answers809
viewsC program "eating" characters when executed
Next, All Ides I program in C are output with characters less with each iteration. For example, when executing a for, every iteration one or more characters disappear: Note that in both netbeans and…
-
0
votes2
answers2249
viewsHow to resolve a string formatting error?
I was programming normally in VS in "Console" mode when I came across this message: "A first chance Exception of type 'System.Formatexception' occurred in mscorlib.dll An unhandled Exception of type…
-
0
votes1
answer527
viewsEliminating spaces in excess of a text
I have the code of a function that should adjust space in the sentence, but it is not working. I’d like to do with input user the same way the function that removes works. Suppose I have the…
-
0
votes2
answers684
viewsHow to read string from a specific word?
my doubt is as follows: If I have the phrase "The rat gnawed on the clothes of the king of rome" How do I read only from "Roeu" to "roma"? This without using numbers, because there will be several…
-
0
votes1
answer150
viewssprintf does not give the expected result
I have variables of the type Unsigned Long Int and would like to save its value in a string, to perform calculation of checksum and send via serial communication. void Payload(int long unsigned…
-
0
votes1
answer451
viewsHow to change a Button’s Text property inside a for
I have a question in ASP.NET, I am creating a loop of repetition inside the HTML so that appear 60 buttons, each with a different number in Text, going from 0 to 59, and then I need to take this…
-
0
votes2
answers4433
viewsTypeerror: 'str' Object does not support item assignment
I made my "version" of a game I saw in a book. def hangman(a): stages = ["", "________ ", "| ", "| | ", "| 0 ", "| /|\ ", "| / \ ", "| " ] wrong = 0 board = "__" * len(a) letters = list(a) win =…
-
0
votes1
answer1416
viewsCalculate a Python string
I would like to make a calculation of a string that I receive, for example: var = '1+2' Wanted to turn this string into an account, to return 3 to the variable var and not '1+2', but this would not…
-
0
votes1
answer616
viewsSearching for separate words in the same string in Mysql
My question is relatively simple, but I couldn’t find an answer that would really help me: My user searches for a name in a form: Fulano Silva The record in my bank is like So-and-so of Tal Silva…
-
0
votes1
answer290
viewsPick only numbers from a String (Tokenizer)
Hello, I’m doing a project with stack and queue, and I’m in a part I need to pick up the operator and put in a pile and the number in a queue. However this part of taking the number is not working,…
-
0
votes2
answers306
viewsSplit String Html
I have an HTML with the following code: <div class="page"> ...Conteúdo1 </div> <div class="page"> ...Conteúdo2 </div> <div class="page"> ...Conteúdo3 </div> the…
-
0
votes2
answers1230
viewsHTML inside a Stringbuilder
I have an HTML where I’m formatting it inside a StringBuilder, where there are "quotes" I am passing a bar, but it is not opening the correct HTML. public string CorpoPaginaHtml() { StringBuilder…
-
0
votes2
answers895
viewsError in using Else
The program is giving an error when compiling. Else without a Previous if Something about the else, there’s something wrong with the condition if and else? #include <stdio.h> #include…
-
0
votes1
answer219
viewsError translating strings previously marked as untranslatable
Hello, has anyone ever been through this? I checked some strings like Untranslatable in the Android Studio String Editor just to speed up the release. In this update, I opened again the Android…
-
0
votes0
answers55
viewsForce array to have all widgets in string
$values_x = array(); for ($i = 0; $i < count( $series[0]['data'] ); $i++ ) { $values_x[] = $series[0]['data'][$i][0]; } $values_y = array(); for ($i = 0; $i < count( $series[0]['data'] ); $i++…
-
0
votes1
answer133
viewshow to convert my object into a string?
I did a function to insert the data into the database, but since I am using classes, I have to insert a class object into the database that will contain the data of the person in question, only that…
-
0
votes0
answers34
viewsParameters between Fragment and Activity
I have an Activity with a Fragment inside, but I want to pass the parameters present in the Fragment when changing from Activity, what I do?
string google-maps android-fragment android-activity intasked 7 years, 6 months ago william silva 21 -
0
votes1
answer36
viewsImage always after 2nd paragraph of a text
Hello, I would like to put picture always after 2nd paragraph of a text, I thought to replace the 2nd occurrence </p> and trade it for the image, but I couldn’t do.
-
0
votes0
answers31
viewsError in compiling my file . tex
The error gives me indication of some problem in the file subcaption.sty, resulting in the following error: ! Undefined control Quence. l.64 \caption@AtBeginDocument {% The control Sequence at the…
-
0
votes2
answers963
viewsI cannot apply Encoder to the text to correctly display "ç, accents, other special characters"
Hello, I need to gather some information from the station, and I’m getting it. However in the received text I cannot apply an Encoder to correctly display the special characters: I have tried using…
-
0
votes0
answers73
viewsString inversion C language
I have to do a show and almost finished the same. Here’s what you ask for: Palindrome is a phrase or word that keeps the same meaning when read backwards, for example bone, he, grate, etc. Make a…
-
0
votes1
answer94
viewsDoubt about Containsignorecase in a textbox
The problem is in the following description : CS1061 error "string" does not contain a definition for "Containsignorecase" and was not can find no method of extension "Containsignorecase" that…
-
0
votes1
answer546
viewsPHP: Character substitution within a string a parti of a certain position
I’m in need of a PHP way to replace parts of strings from a given position, for example: String: aaaaaaaaaa Replace from the 3º character by "-" Result: aaa------- or String: aaaaaaaaaa Replace…
-
0
votes3
answers1211
viewsRemove last character from a string when the character is a blank
Good afternoon. I am programming in java and want to get the initials of a name, in case: "Jonas Barros Santos" Must appear : JS The code I use does this, but if the person puts the name with space…
-
0
votes1
answer44
viewsDifference in string size with Fontmetrics.charWidth and Fontmetrics.stringWidth
I’m not getting the following code: String text = "C JEA NAV/NAP GRV NAV/ELT NAV SOLA PVC EXP PRETO "; int posString = FONT_METRICS.stringWidth(text); int posChar = 0; for (int i = 0; i <…
-
0
votes2
answers467
viewsCalculation of word similarity with Java
For two string A and B, we define the similarity of these strings is the length of the prefix that is common to both. For example, the similarity of strings abc and abd is 2, while the similarity of…
-
0
votes1
answer1074
viewsHow to replace a middle character of a string and swap for two characters?
For example, Char s1 [ ] = "azul"; Char S2 [ ] = "z"; Char S3 [ ] = "PP"; Puts(s1); //azul Code to replace... Expected result: Puts(s1); //aPPul Note: I was able to change 1 character by another,…
-
0
votes2
answers36
viewsRemoval of string in script
To edit this file and remove any incidence of [[*m as I edit sed? The incidences are marked in bold. sed’s/ [[*m//g' file The backup routine is still running on the server! The backup process began…
-
0
votes3
answers902
viewsHow to convert text field with mask to double
I have a field in the html text type that has a coin mask. I have to save this value in a field of the kind double in the database, but I’m having trouble converting, where the value that would be…