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
-
2
votes1
answer1600
viewsConcatenate columns and some with NULL value
I’m making a select and concatenating the columns, when a column has value NULL (has no value ) the whole line is NULL follows an example: select…
-
2
votes1
answer97
viewsProblem in condition to handle string
It was only supposed to work with lower-case letters and when it arrived at symbols it did not change, but they are being changed. What’s the problem? #include <stdio.h> int main() { char…
-
2
votes1
answer3472
viewsString comparison (which answers hours) in javascript is reliable? How does it work?
It is known that, in terms of time, that 07:30 is less than 08:30 - speaking of hours. In javascript, if we make this comparison, everything goes as expected above '07:30' < '08:00' // true…
-
2
votes2
answers52
viewsreturn Coredat - Swift
I am unable to assign a textField with the result of a search when it is int, with the right string var results:NSArray = try context.executeFetchRequest(request) as! [NSManagedObject]…
-
2
votes1
answer72
viewsFormat string Qt html charset
I have the following string: Qstring str = "Macarr & # x and 3 ; the integral. < br/>" (I put space between all characters of the special character if it would not be visible and would…
-
2
votes2
answers339
viewsString reading and input buffer
I always used the fgets() function to read keyboard strings, because it (at least I thought so) always clears the input buffer. However, I am finding some errors with the execution of the function…
-
2
votes1
answer307
viewsWhat is the difference between Qstring and Qstringliteral?
What is the difference between the two? What is the best to use?
-
2
votes1
answer748
viewsHow can I abbreviate a name to 2 words, ignoring (from, da, dos, das)?
I have a user table on the system where the full user name is registered. But, when displaying these names in the system, I should only use two words of that person’s name to display. And when the…
-
2
votes1
answer506
viewsError removing accents from a string for creating friendly Urls
Ola would like to know how I can get around the mistake that this being caused in the code below. When I accentuate special characters they are being removed instead of converted. I caught this code…
-
2
votes1
answer150
views -
2
votes0
answers50
viewsHow to remove accents in R?
How to efficiently remove accents and tilde in the R? What I want to do is to do it in a more practical way than to specify the substitution letter by letter. estados=c("São…
-
2
votes1
answer19917
viewsHow to read text files and put words into an array?
I need to make a code that reads a text file (txt) and save only the words at the positions of a vetor, below follows my code: int main(int argc, char** argv) { FILE *file; file =…
-
2
votes2
answers2969
viewsHow to sort and sort strings without using Collection?
I am creating a register of employees with some fields(name, email, phone and salary) in ArrayList which are recorded in txt. After the data is entered into the array (before passing to txt) they…
-
2
votes1
answer403
views -
2
votes2
answers268
viewsTaking a partial name from a process
Is there any way that I can get a process that’s running under a partial name, like what happens to like in a survey SQL? 'Cause I ask this, I got one team viewer customized here for the company.…
-
2
votes3
answers3377
viewsHow to eliminate excess spaces in a string?
C code to remove strings spaces is not working. It stops at execution. #include <stdio.h> #include <stdlib.h> #include <string.h> void removerSpacos(char str[]) { int i, j; int tam…
-
2
votes1
answer1522
viewsHow to concatenate a string and an integer value in javascript?
Well, I have 15 similar lines in my code and the only thing that changes is the id of the elements that end in an increasing and different integer... I tried to replace these lines using a loop, but…
-
2
votes2
answers1420
viewsRead numbers separated by commas
I need the sixth figure printed on a arquivo.txt. I tried to read the file and print the first six on the screen to see if it was working, then generate a file with only the value I need organized,…
-
2
votes2
answers5403
viewsCut the last character of a string C#
I’m creating an export from SQL for the TXT. With this I add the ";" tab after building each column. But at the end of the last column you are adding ";" as well. How do I get this ";" from the end…
-
2
votes1
answer205
viewsHow to script auto-complete/increment
There was a need to create a text field that would receive names of cities, however complete the word in the field when starting the first digítos. I need some idea, function with Arrays literals,…
-
2
votes1
answer573
viewsRegular PHP expression, how to remove open html tags?
Hi! I need to remove an html chunk that bugged my string, it looks like this: e="text-align:left;"> Texto normal ... This generates a visual error. Another error generating is at the end of the…
-
2
votes2
answers109
viewsVariable outside matrix boundaries
I’m trying to put the items in positions of a matrix, but I keep getting the error that the variable is outside the matrix limits. I don’t know how to fix the mistake and I need help. Follows the…
-
2
votes1
answer57
viewsString Validations
I’ve been researching how to validate e-mail, dates, times etc. And in the case of e-mail, I found a code like this: /^.+@.+\..{2,}$/;. It is incomplete. But I wanted to understand what these…
-
2
votes1
answer254
viewsJavascript function with Nan error
This function is returning error: Nan, to convert again to text. function floatToMoneyText(value) { var text = (value < 1 ? "0" : " ") + Math.floor(value * 100); text = "R$ " + text; return…
-
2
votes1
answer838
viewsHow to validate Date with Regex?
I am trying to capture a date inside a string using regex, but when I try to recover the part of the string returns me the following error: analyzing " TARIFF:([ d/]+)" - Unrecognised exhaust…
-
2
votes2
answers286
viewsConvert an Ipaddress to string
This code retrieves the gateway standard, but I can’t convert the result to string and put on a label. public static IPAddress GetDefaultGateway() { var card =…
-
2
votes1
answer316
viewsstring to object in javascript
I am receiving an object as a parameter, for example: "4,5", from a function, but I need to exchange the comma for a point. Qnd I do this, the object is changed to string, so I need to return this…
-
2
votes3
answers441
viewsHow to concatenate string with null without explicitly checking?
When I try to concatenate one String which, in fact, is null with a string valid (e.g., "a"), get the value nulla. See the example below: String a = "a"; String b = null; System.out.println(b + a);…
-
2
votes1
answer81
viewsDelete symbol from the last position of a string, optimally with PHP
I would like to delete the last character of a string if it is a symbol. I know I could do it in a complex way like the following function: $string = "minha_string_com_simbolo_no_final_"; function…
-
2
votes1
answer195
viewsSearch text in a String as a "like"
I want to do a text search, like the ones I do in Mysql. Ex: LIKE "9%4" I tried to implement a find_if(), but without success. #include <iostream> #include <string> #include…
-
2
votes1
answer85
viewsPOST coding
In web requests when posting data on a server string of the model below (using the parameters): string hello = "hello"; string token = "teste=="; It is transformed into post data equal to those…
-
2
votes2
answers435
viewsConvert String with AM/PM to Datetime
I have a variable that contains a date with AM/PM: string data = "01/08/2016 9:00 PM"; When I try to convert to DateTime using the method TryParse the result ignores the designator "AM/PM". string…
-
2
votes2
answers1011
viewsProblem running project - Special characters
Good afternoon, I migrated my project to Intellij IDEA and when executing a code that should print an accentuated string, I got the return: "m? all" (method). Classes display the accent correctly…
-
2
votes2
answers116
viewsWord problem with same letters
I’m solving a problem where I get one array of strings with different words, I have to find out for each word (string) which are your friends. Friendly words are those that have the same letters in…
-
2
votes1
answer743
viewsCompare two strings and show difference between them
I accidentally clicked on a post It was edited here and I saw that Stackoverflow showed the differences of the edition. Soon, a lamp flashed over my head and now that I’m dealing with a CVT project,…
-
2
votes1
answer874
viewsHow to store letters in a variable and display them all at the end by forming a phrase/word
I’m holding up programming and I’m making a code where I’m supposed to turn a binary code into a phrase. I’m turning the binary value into decimal, and taking the decimal value and comparing the…
-
2
votes1
answer3401
viewsConvert hexadecimal string to C-readable output
I would like to save a text in hexadecimal, and calling a function, the hexadecimal string is converted to a readable char string, i.e., decoding the hexadecimal, for example 0x6f0x69 for oi. I…
-
2
votes2
answers5533
viewsReturn string in C for manipulation outside the function in which it was declared
I must develop a calculator that reads strings in the algebraic form of the complex number operation. I need to manipulate the "main" vector outside the function in which it was declared (receives).…
-
2
votes1
answer624
viewsHow to truncate text without cutting words . NET?
I’ve been trying so many ways for days but I haven’t been able to do this script take the value of <h3> and return the text to it truncated. Javascript: <script type="text/javascript">…
-
2
votes2
answers143
viewsSeparating a String, how do I do?
I have a: String url = intent://instagram.com/_u/fabiohcnobre/#Intent;package=com.instagram.android;scheme=https;end How do I separate her so that I get one String link =…
-
2
votes1
answer429
viewsHow do compiler recognize . as decimal separator?
I made a simple code in C# that receives a real number but only recognizes "," as a decimal separator. When I make you receive numbers that use "." as separator it ignores the point. For example, if…
-
2
votes2
answers85
viewsReplacing characters in a string
I have a string to be passed through the form and would like to replace some characters of it so that it is in the form of numeral: if(form1.autonomoBonusBruto.value.includes("R$")){…
-
2
votes1
answer1026
viewsDoes the scanf record string on pointer that does not have a defined size?
I’m trying to understand how the strings in C. I noticed that even not defining in any part of the code any limit for the vector TextoUm[] (which follows in the code below), the function scanf can…
-
2
votes3
answers924
viewsFormat String
I have the following example code: String _randomTag = "pvp"; String _randomTag2 = "otherName"; String _format = "{tag} {player} {" + _randomTag + "} {" + _randomTag + "} > {msg}" String _result…
-
2
votes2
answers11603
viewsHow to break lines (console mode)?
How I break lines in C#, as if I put two commands Write the console will print them side by side, as I do to print on the bottom line. Ps: Code below var A1 = Console.ReadLine(); var A2 =…
-
2
votes3
answers1098
viewsProblem with Padleft
I have a problem using the Padleft method. I need to put some zeros in front of a string, but I’m not getting it. For example: string value = "2001795"; string newValue = value.PadLeft(5, '0');…
-
2
votes2
answers122
viewsString comparison
Problem : I have to get the object that displays the content in the English language ( lang == en ) But depending on the search performed the order of the languages comes completely different and I…
-
2
votes1
answer76
viewsError: argument of type char is incompatible with lpcwstr
#include <iostream> #include <Windows.h> #include <TlHelp32.h> DWORD getbaseadress(DWORD Pid, TCHAR* n); using namespace std; int main(int argc, char* argv[]) { HWND hwnd = 0;…
-
2
votes3
answers92
viewsManipulate String in JAVA?
I have an appointment of SQL that the content brings me so: [email protected];[email protected] I only need the first address, I have to disregard everything from the ;?…
-
2
votes1
answer1676
viewsCannot Convert from 'string' to 'System.Iformatprovider'
Follow the code (works): var teste = 1; var teste1 = teste.ToString("000000"); Upshot: 000001 Follow another code (does not work): var teste = "1"; var teste1 = teste.ToString("000000"); Upshot:…