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
votes2
answers3247
viewsSeparating strings from an Arraylist with comma
I don’t have much knowledge of Java, I would like to separate the string from my List, with ", ". List<String> nomes = Arrays.asList("Paulo", "Ana", "Zeno", "Beno"); for(int i=0;…
-
2
votes1
answer1249
viewsFind a numeric group in the string
Hello, I would like a help to locate a group of 20 numbers within a string that has characters and symbols. Let’s say my string has 165 characters, I want the numbers from 127 to 147 that are my…
-
2
votes1
answer1039
viewsSeparate address path from string
On my application JAVA, on a screen, I have fields referring to the address, I have two means of registering this address, I can pick up automatically searching for the zip code most of the…
-
2
votes1
answer119
viewsTimespan conversion
I am reading a file delimited by semicolon and one of the information that is the duration of the link is coming as "00:97:54". When trying to convert to Timespan, obviously gives error The Timespan…
-
2
votes0
answers58
viewsPLN - Ideas on how to identify subject and predicate
I started working on a project in my spare time. At the moment I need to know how to identify the subject in a sentence, of course a phrase in br Portuguese is composed of subject + predicate, I’m…
stringasked 7 years, 5 months ago Pablo Rodrigo 21 -
2
votes2
answers107
viewsGet content that is before the number using regex
$MinhaString = "Aventura, Fantasia, Ação 25 de maio a 31 de maio" I tried to do it this way, only it doesn’t work. $Genero = strstr ($MinhaString,"/[^0-9]/",true); I only need "Adventure, Fantasy,…
-
2
votes2
answers348
viewsMatch in regular expression with special REGEX symbols and line breaks
I need help with a regular expression match in a string whose: beginning and end of a line with the character } keep marrying everything you find in the next line (including other "escaped"…
-
2
votes1
answer108
viewsC program to concatenate strings does not execute correctly
include int main(){ void concatenarStrings(char string1[], int t1, char string2[], int t2, char string3[]); char palavra1[]={'p','a','o','c','o','m'}; char…
-
2
votes2
answers2462
views -
2
votes2
answers246
viewsString for Keyvaluepair using LINQ
I am receiving a string in the format "N1N2S3S4L5L6O7O8X" and I need it passed to a KeyValuePair or for a NameValueCollection. Where the key is the letter and the number the value. { N, 1 } { N, 2 }…
-
2
votes1
answer3318
viewsHow do you use Cin.get() in C++?
i would like to know more about the Cin.get() function and also the difference between it and the getline() function because whenever I research something related to it I see more search results…
-
2
votes2
answers475
viewsUntreated exception (index based on 0)
My idea is to make a small registration and I’m testing this to later add this data in a BD. The problem occurs on the line Console.Write("\nGenero do disco : {1}", genero);, at the time of…
-
2
votes2
answers127
viewsPick specific characters from a string?
I’m getting the following Javascript string: Nome Sobrenome <[email protected]> How do I pick up only the email inside <>??
-
2
votes1
answer360
viewsExport Table to Excel, Problems with String Numeric
I looked here in Stack, but maybe I did not find the right question, I am exporting data from PHP to Excel with HTML tags, it exports in a good way, I happen to have a column that is String, for…
-
2
votes3
answers914
viewsInsert two points into the string
I have the following string: $valor = "0050"; How do I insert two points after the second house and stay this way? 00:50
-
2
votes1
answer885
viewsIs there a difference between using backslash and simple?
I wonder if when it comes to doing upload of a file, like this: $destino = 'imagens/' . $novoNome; There is a difference between imagens/ and imagens\?…
-
2
votes3
answers6300
viewsHow to add numerical values inside a C string?
Good morning, I need to write a code that receives a number and returns the sum of the digits of that number. For example, if the user type 123456789 the program must print 45 (1+2+3+4...). I think…
-
2
votes2
answers1331
viewsHow to remove the value of the last Textbox position with Substring?
How to remove the value of the last position of the TextBox with the Substring? Suppose the TextBox receive a value with this mascara = 0,00%, however, I just want to save the numbers and not the…
-
2
votes1
answer97
viewsCompare a string array with another string array and create a new array
I need a method/algorithm to find in array1 strings of array2 and create a new array (array3) with all Stings separated from array2. For example array1 = ['azxsdfghjkazxfgtfgt']; To array2 would…
-
2
votes2
answers1623
viewsChecking whether a string is empty in Javascript. Idiomatic or readable?
I understand that it is often best to value the readability and clarity of the code by programming explicit. This does not only stop the Javascript, also the C#, Python and perhaps the rest of the…
-
2
votes2
answers439
viewsTag html inside a string displayed one character at a time
When I run the code it writes the "<" of the tag before interpreting it, I would like it to interpret the tags directly without writing their opening sign var TxtType = function(el, toRotate,…
-
2
votes1
answer176
viewsSplitting string in C
I am very beginner in C yet, but I have a lot of experience with python, I have a project that I need to receive from the user 3 numbers in the same line and make a vector with these 3 numbers in…
-
2
votes1
answer721
viewsHow to join two tables using auxiliary table and LINQ
I have the tables People and Representatives, where in my application the person may or may not have representative(s). public class Conta { int PessoaID; string Nome; String Documento; } public…
-
2
votes1
answer447
viewsHow to split by numbers inside the string?
String following: 1No começo Deus criou os céus e a terra. 2A terra era um vazio, sem nenhum ser vivente, e estava coberta por um mar profundo. A escuridão cobria o mar, e o Espírito de Deus se…
-
2
votes1
answer210
viewsGet part of a string with Regular Expression - C#
Based on the string "Plan Liberty Company +50 - 043-98965-2784(058/POST/SMP)", I need to get the part of "043-98965-2784". I realized that in the txt file I’m using, the numbers follow the pattern…
-
2
votes1
answer967
viewsPHP: How to convert a number into a string?
I have an application that generates a PDF receipt. But in the bank the values have to be converted into words BD | PHP 10 | TEN 15 | FIFTEEN 7 | SEVEN there is some function that returns the string…
-
2
votes3
answers142
viewsHelp with java arrays
I have the discipline array and the current array. The current one is an exact copy of the disciplines. If there are two equal Strings within the disciplines array I need to delete all the same and…
-
2
votes4
answers3505
viewsHow to generate random characters or string?
How to specify the number of times a character can repeat? Ex: I have ABC, where C should repeat 4 times in a new string 6-character: ( AB CC CC ) or (AC CB CC) or ( AC CC CB ) To can only enter…
-
2
votes1
answer512
viewsHow to delete characters from a string within a Python array
I’m starting in python and decided to mess with files .txt. I did the following procedure to insert values into an array, and from it insert each value into a row of a file filename.txt. def…
-
2
votes1
answer52
viewsHow is the encryption of a Securestring made and stored?
The class SecureString is used to represent a text that must be kept confidential in memory (passwords, card numbers, balances, etc.), and carries out its correct deletion from memory when said text…
-
2
votes1
answer187
viewsHow to separate a string in Unity c#
I wanted to know how to separate a string in Unity C#, I ended up looking at some similar questions for C# punch not in Unity, I often found this example string[] linha = reader.ReadLine().Split(new…
-
2
votes1
answer300
viewsBreak text and vector store
I want the program to be able to store only one sentence per line. Each sentence is possible to be completed according to the signals I show in my code example. It does this but when printing on the…
-
2
votes1
answer259
viewsCalculate occurrences in the overlapping string
would like to know how to make how many substring combinations is possible within a string, ex: string = 'abcdcdc' sub_string = 'cdc' the returned value I want in this case, is 2, because the code…
-
2
votes2
answers1067
views -
2
votes1
answer760
viewsHow to remove non-numeric characters?
I want to remove all non-numeric characters from a string. I found the function isdigit that could help me. With it, I’ve gone through all the characters of a string and those that are numeric, I…
-
2
votes1
answer136
viewsIs it possible to omit the numbers of the "String.Format" formatting arguments in C#?
I was seeing that in Python is possible format a string without numbering the arguments. Example: #mensagem = "Meu nome é {0} e minha idade é {1}"; mensagem = "Meu nome é {} e minha idade é…
-
2
votes3
answers8071
viewsASCII in Python
Hi. I’m from C and I’m starting to learn Python. I have a question to move the characters of a string 3 positions and in C would look something like this: str[i] += 3; I tried to do the same thing…
-
2
votes2
answers393
viewsCompressing a string to upload into a field of the JSON object
Hello, I am developing a java API, which returns a json object. One of the final json fields is long text, of unknown dimension. Text may or may not contain special characters. I am sending the raw…
-
2
votes1
answer103
viewsLabel concatenating subsequent results, how to clear the previous result?
Explanation I have two label elements that receive the results of an account made within the code (lamp expense calculator), when I click to calculate, it calculates and inserts the result of the…
-
2
votes0
answers54
viewsTypeerror: not all Arguments converted During string formatting - Python 3.6 - Power Bill
I am a beginner in the area and during the programming studies in Python I was stuck in this exercise, the goal being to appear on the screen of the user how much he should pay per kwh used,…
-
2
votes1
answer58
viewsChange Javascript string characters for successors
I have a string, for example, acbd and want to get another string bdce, formed by the successors of each character. In my searches find a possible way that is to transform the string into an array…
-
2
votes2
answers2215
viewsRegular expression to find numbers in between words
Currently I am developing a project of which I am using regular expressions to find certain patterns, however there is a String specific and need to extract two numbers from this, the expression is…
-
2
votes2
answers67
viewsWhat is the best performance in comparison of string sizes?
What is the best performance option? And memory allocation? Using option 1 or 2? String text = "ola mundo"; Option 1: If ( Strings.len(text) > 0 ) {} Option 2: If ( text != "") {}…
-
2
votes1
answer175
viewsHow to get the number of lines from a Stringlist and apply?
I have a StringList inside a file mensagens.txt, I’d like to count how many lines there are StringList contained within that file. For each line of the string 1 code will be executed within the…
-
2
votes0
answers46
viewsLiteral strings Corona Moon
I’m a little lost in the use of \t. On the console, it works and in the simulator it is ignored. If anyone knows of a possible solution. local myText = display.newText("a\tb", 200, 100,…
-
2
votes1
answer104
viewsWhy does adding a variable, property, method, etc. to a string work?
When I add a variable, property, method, enumerator, etc. into a string, it works, even though I’m not calling the method ToString() for example. Example with type and integer: var example =…
-
2
votes1
answer1977
viewsPath to a python character
I adapted a program in Python that solves labyrinths, and I’m improving it, but I had problems with the minimum path (I even studied in Graphs), I was able to understand everything. But I’m having…
-
2
votes1
answer105
viewsC++ Std::string.c_str() always returning NULL
I recently asked a question, because istreambuf_iterator does not work on android NDK, as I had no answer I decided to investigate myself, I created a project in Visual Studio 2017, simple thing,…
-
2
votes2
answers541
viewsCutting strings from right to left
I have a column in the database named after codigo, where the formatting is like this: 18000001 Where the 18 means the year we are and the 1 is the code of each result. Knowing that this code can be…
-
2
votes1
answer1446
views