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
-
3
votes2
answers368
viewsCount occurrences of a letter in a string that repeats several times to a character limit
In this problem I have to count the number of times the letter appears 'a' in string 'a' range 1000000000000, only that I have run time error when it is a very high number like this. for example: if…
-
3
votes1
answer60
viewsFind content between 2 strings inside a giant string with Regexp
I need to create a function that takes the frame number and takes its contents from a file . txt with more than 3000 lines. Every table has the following configuration: Starts with "Frame X" and…
-
3
votes2
answers200
viewsEliminate consecutive duplicate string letters
How do I scroll through an array of strings and delete consecutive repeat letters? Incoming: String[] x = {"lleonardo", "joaoo"} Exit: String[] x = {"leonardo", "joao"} I created the function below,…
-
3
votes2
answers127
viewsHow to detect Start Codon and Stop Codon in a nucleotide sequence using Python?
I am trying to solve an exercise in which a function with a start and a stop, where the start should occur when you find "ATG" and the stop when you find the "TAA", "TAG", "TGA". With the help of…
-
2
votes1
answer117
viewsIs it possible to use Query String and Hash at the same time?
I am developing a one-page site only using the hash’s html to scroll the page until the id specified, but the need to use also a query string with php, but now every time I try to use both of them…
-
2
votes1
answer149
viewsString handling with str_replace
I’m trying to treat a string with the function str_replace but I wanted to insert a <span> before the word treated, as in the example below: $entrada = array("//"); $tratamento =…
-
2
votes1
answer115
viewsHow to determine if a string value is in XML format?
I am connecting with an API, or service as you wish, which returns an xml when it finds data in the database, but unfortunately it returns a string if nothing is found or an error occurs. In my…
-
2
votes3
answers4604
viewsCount characters without empty spaces
I have to count the number of characters in a string, but when there is empty space it is counted as a character. How do I remove these empty spaces? Any tips?
-
2
votes5
answers7780
viewsHow to use str_replace in single quotes without removing the ones that are required?
I’m going through a database of a friend who had some data entered wrong or a little confused or I’m the one who’s making it difficult. Ex: Mariana "Gurizinha’s" This example was saved in the bank…
-
2
votes5
answers6608
viewsCapture dates of a text using regular expression in javascript
I have a function that returns data in JSON and places in certain places with jQuery. One of these data is a text that contains a period of dates (Beginning and end). Example of returned text:…
-
2
votes1
answer3327
views -
2
votes2
answers513
viewsHow to put between within a code query?
I have the following consultation and I would like to put in the clause Where the condition of being within a certain period. public static DataTable stCloseCaseAll(int schoolId, string dataInicial,…
-
2
votes3
answers71
viewsWrapping part of a string
I’m testing a function to select the part of a title that comes after the two-point sign: $('.carousel .item .carousel-caption h2').each(function(){ var val = $(this).text(); console.log(val); var…
-
2
votes1
answer1578
viewsDelphi: How to get information and manipulate Html in a Tstringlist?
Working with the TWebBrowser you can easily interact with the elements, get fields, set values. Example: webBrowser.OleObject.Document.GetElementByID('name').setAttribute('attribute', 'value'); My…
-
2
votes1
answer836
viewsError writing text file: cannot Convert Std::string to const char*
I’m not getting a record string on file .txt in C++ (Codeblocks). // aux é um inteiro // aux2 é uma string // foi dado fopen no arquivo...abaixo só segue a parte com erro aux = x.retorne_energia();…
-
2
votes2
answers384
viewsMysql import . txt - string values
I have a TXT file that contains several different records, in some cases I need to get the information that is between 2 strings, e.g.: Cliente: FULANO DE TAL CPF: I need what this between Cliente:…
-
2
votes3
answers165
viewsRotate text and replace first link
I have a variable named $text where text is stored that the user writes. `$text = "Hahahha that cool this site, I was able to answer all my questions there /" ` What I need? I have a function named…
-
2
votes2
answers1417
views -
2
votes1
answer11363
viewsConvert string to function array
I need a function that converts this string into an array as follows 3:2,4:1,5:1 //string array ( [3] = 2 [4] = 1 [5] = 1 )
-
2
votes2
answers548
views -
2
votes2
answers253
viewsReplace in large string or split loop
I have a multidimensional array with some routes and need to do the conversion of some elements defined as: (alpha), (int), (id), etc. As it is an array, at the moment I use a loop to do the…
-
2
votes2
answers694
viewsHow to pick a phrase value in String
example have a return this way from Webservice "Success! Saved user. Id: 257" all right I’m picking up the phrase as : Success! Saved user. Id: 257 need only take the number or is to take the 257…
-
2
votes2
answers426
viewsstr_replace using arrays
I want to blacken the terms searched in the results, but when I use the explode, and I try to use in str_replace, I get a array back. <?php $search_term = filter_var( $_GET['s'],…
-
2
votes3
answers4786
viewsLine break into email message
In my string mensagem, i would like to have a two line space, I tried using "/n" and I did not get the expected result. @{ var customerName = Request["customerName"]; var customerEmail =…
-
2
votes2
answers660
viewsPrint associative array element inside string without concatenation
I have to print out a tag HTML via a echo with the value of a array associative, however I can’t make it print to be concatenative use. Code .php (this way is not working, I believe by the quotes…
-
2
votes2
answers3451
viewsRead a comma separated string
My reading has been established to the comma, but he’s reading the whole field to the end of the line when reading the string. The code is read correctly, but only in the code. #include…
-
2
votes1
answer218
viewsError comparing two strings
I’m trying to compare two strings, when I enter a name in my chained list it cannot be entered if it already exists. I have used the function searchname to display a searched name and to delete, but…
-
2
votes2
answers816
viewsConvert hexadecimal to integer
I have this hexadecimal value "E365A931A000000". I need to convert it to integer I’m using the following code. string hex = "E365A931A000000"; CodLibercao = Convert.ToInt32(hex); This code is…
-
2
votes1
answer985
viewsSave information from a form
Hello, I’m developing an online proof system as the following image: The questions come straight from the database (MYSQL) and so mount the proof displaying question by question, when the user marks…
-
2
votes2
answers1749
viewsTurn string into number
I have a problem that for many are simple, I have a code that takes the value of a input of the kind hidden and when I pick up this amount, I add +1, ie if the value is 3 it add +1 and have to stay…
-
2
votes2
answers227
viewsHow to replace Regexp in editable div using Javascript?
I have a div editable where I capture all text within it. Hence I want in each occurrence of certain word this word is replaced by another. Very simple. The code I tried did not work. It itself…
-
2
votes2
answers1207
viewsReplace values inside string
How do I replace values within a string? To string will be something like: gabriel = 1.73,derp = 1.80, Take into account that this structure is: nome = altura, nome = altura,. In case, I want to…
-
2
votes2
answers220
viewspreg_replace with Regex to add a tag
Does anyone know how to make regex select the phrase and add a tag? <li> <p>b) texto muito longo;</p> </li> $FechasemClassAlinea =…
-
2
votes1
answer467
viewsHow to separate a string into several in java?
My problem is basically the following, I have a JSON code that takes the data from a URL, and returns it to me (The values are in Long) 528593 444218 5693595 2466912 2466435 However, it returns this…
-
2
votes2
answers65
viewsGet two snippets of a confusing string
*It’s very simple my question: How do I get the string Argumento1 and the string Argumento2, separated into two variables in this code of a language that I’m doing: if Argumento1 = Argumento2 (…
-
2
votes0
answers45
viewsPHP syntax Highlighter - DOM object does not update HTML
I’ve been developing a code to do syntax Highlighting, but the code is failing to update HTML. The code is extensive, and unfortunately all of it is necessary. I have a main file called…
-
2
votes1
answer453
viewsitt' is not recognised
I am trying to compile the code below with GCC 4.7.4, but always get the bug error: ạ itoa' was not declared in this Scope #include "otpch.h" #include <iomanip> #include <stdlib.h>…
-
2
votes2
answers61
viewsTransform into json
I have a string: {name:"Sara", daypart:"day", href:"/questions/ask", bg:"su", temp:"calor", realfeel:"hot", text:"cloudy"} Basically I’m looking for a quick way to turn this into JSON, I mean, quote…
-
2
votes2
answers1623
viewsConcatenate number sum to a string
I want to concatenate a sum of a number to a string in Javascript and had to resort to an auxiliary variable. What I did first (incorrect example): for (var i; i < x; i++) h = "texto" + x+1 +…
-
2
votes1
answer129
viewsHow to get only a part of a string from a pattern?
I have a string in Lua language. I want to get only the part of filename through the match (403.htm.en). Example: var=[[Content-Disposition: attachment; filename="403.htm.en" Content-Type:…
-
2
votes1
answer270
viewsIs there any way to translate the error messages produced by PHP?
Is there any way to translate error messages in PHP? Example: English Use of Undefined Constant X Português Use of indefinite constant X…
-
2
votes1
answer51
viewsGetting multiple values from a String
Is there any way to get the arguments like in the example below, in a separate variable? I’m creating a language, and this is an example block: for 0 to 250 step 50 ^^^ ^ ^^ ^^^ ^^^^ ^^ Then I used…
-
2
votes1
answer408
viewsQuery vector from one table to update another in C
Hello. I’m new here and I’m not even sure I was objective in the title. But come on. I’m almost done with my final C Algorithms project, and I’m unable to update one item from one table with…
-
2
votes1
answer222
viewsJava - String - Comparison
I’m not getting a simple comparison I’m making, but it’s not performing like I think it should. Situation I request that the user type the person’s name, and capture with String nome = scan.next();…
-
2
votes2
answers1486
viewsCompare strings to accents, UTF-8
Something is escaping me here, I am doing Curl to a weather page, if the results have accents and comparing with exactly the same string in full this condition returns false (not equal). This is…
-
2
votes1
answer279
viewsStore part of a string in a variable
I receive the string below, through a response.StreamReader: 240144|000|5511946724649|2015-08-30 21:45:51|2015-08-30 21:46:02|1| How should I proceed to store the content between the Pipes each in a…
-
2
votes4
answers29520
viewsPrint strings in alphabetical order
I’m trying to do here because the user provides 3 name at least so I have to sort these names in alphabetical order, had tried with strcmp, but I didn’t really understand the concept of this…
-
2
votes2
answers1416
viewsBreak txt file into blocks, and each block into rows
I have an "active.txt" file where you can find information blocks Ex: SACOLAO CENTER R RUA PAULINO MENDES LIMA,31 CENTRO 45820440 EUNAPOLIS BA UNIQUE PISOS E REVESTIMENTOS R PAULINO MENDES LIMA,84…
-
2
votes1
answer571
viewsTake all html tags minor to line break
My doubt is simple, I think. I receive via post the description: $descricao = strip_tags(mysql_escape_string(trim($_POST['descricao']))); And when I print on the screen I use:…
-
2
votes1
answer6140
viewsRemove X first elements from a string
I have the following code: copia = num.Text; copia = copia.Substring(cobrar.Length + 1, copia.Length); num.Text = copia; Where copia receives a string from a textbox and cobrar is a predefined…