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
votes1
answer150
viewsVFP - SQLEXEC is returning DATE field as CHAR
I am supporting a "legacy" application written in VFP, which uses DBF tables and now migrating to SQL Server. I created a test table in SQL, which contains fields of some basic types, to be able to…
-
1
votes3
answers222
viewsRemoving characters from a string - Python
Guys, I have the following problem. I have a function that returns me the following output: "Address:58.200.133.200" I would like to save this value in a variable ip, but I only want the part of ip…
-
1
votes1
answer458
viewsOffline PHP connection string
I’m trying to connect offline to a Mysql base, but I’m not getting. The code is on my machine, I’ve tried by IIS and XAMPP but every time I try to connect, it presents an error. Follow the…
-
1
votes3
answers2790
viewsRead a string with line break
I need to compare two strings to see if they are equal. One of them is in a vector of struct and was dealt with the fgets, so it’s a line break. The other one is informed by the keyboard. I wonder…
-
1
votes2
answers76
viewsGiven the given String below, how do I define this division?
I have the following string: "User Data: JOAQUIM DE OIVEIRA, NASCIDO IN 2010, GRADUATED IN: LAW, HOBBIE: FOOTBALL" How do I give one explode in that string only by validating the first sign of…
-
1
votes1
answer784
viewsDismember full numerical expression in C
Hello; I have a code that should be done in the C language, which is to receive a numerical expression, including the result of it, for example: "20+30=50", which will be stored in a string. After…
-
1
votes2
answers474
viewsConvert an entire number from the database into an Array
I want to convert an entire number from the BD into an Array, for example: I have the number of deliveries registered in the BD, let’s assume that the 'x' production is completed in 5 deliveries.…
-
1
votes2
answers1472
viewsOnly get words from A-z and numbers 0-9
How can I remove anything other than a letter and number string, that is to remove (!@#$%^&*():"><?} etc.) and keep only the letters of a-z and numbers of 0-9
-
1
votes1
answer1225
views -
1
votes1
answer670
viewsToggle action from a button
I’ve been searching the internet and I haven’t found anything that can explain me how I do to switch the action of a button in Java... Example: I have a button that when I press it I want it to…
-
1
votes1
answer103
viewsConvert reverse_iterator to iterator?
I am writing an XML interpreter in C++, when I find a bad formation in XML I would like to show the error row and column. I am working with string Iterators and created a function to format the…
-
1
votes1
answer5171
viewsCheck if field is empty using custom C reading function
void vazio(void) { char *str = NULL, c;//apontando para null int i = 0, j = 1; //alocação de memória para str str = (char *) malloc (sizeof(char)); printf("Informe a string: "); //ler a string while…
-
1
votes2
answers599
viewsHow to request input data N times, and concatenate this data
First I asked the user to enter the amount of links that he wanted to add to the file (in this case a string), hence if for example he type 4, I want to ask the question "Download link: " four times…
-
1
votes1
answer626
viewsHow can I show the next 7 Days (Calendar) C#
Hail, good night I am working on a C#solution, where I have to develop an agenda and at some point I intend to show the events (if any) as well as show the following 7 days, even if they are not…
-
1
votes1
answer933
viewsHow to convert a string to a number in Lua?
In Lua, how to convert a string type value to the number type (integer, float etc.)?
-
1
votes1
answer598
viewsHow to select a String in column format? SQL SERVER
I have a field STATUS in a table with the following data: VENDA,COMPRA,DEV.VENDA I need to make a query in this field that the result is a column, where each row will be one of the strings between…
-
1
votes2
answers1247
viewsProblem inserting double value in Mysql
query += txtServidor.Text + "',";<br> query += double.Parse(txtVencimento.Text) + ",";<br> query += int.Parse(txtBanco.Text) + ",'";<br> INSERT INTO tbl_associados…
-
1
votes1
answer56
viewsCheckbox values in array session as string
I intend to join in a array the values of a checkbox but how string and so that they are separated by array('string1','string2'), to be able to use in a mysql query IN('string1','string2'). These…
-
1
votes1
answer76
viewsType conversion going wrong
I have a data conversion problem when going through For Each, accuses the item "vl_maodeobra" cannot be converted from String to type Integer. The problem is that no matter what conversion I try to…
-
1
votes1
answer111
viewshow to force a buffer to behave like a string in C?
I am receiving a buffer from the internet, I believe that to go through this buffer and find the last character, you need to find the character ' 0'. But there is no ' 0' in a buffer. It is possible…
-
1
votes1
answer58
viewsFind occurrences of a word
I have a text and would like to find certain words, but in the way I’m doing that is with the substr_count() I can only find the word as I wrote it. Example $text = "Eu sou um Menino e gosto de…
-
1
votes1
answer96
viewsActivators (triggers) in PHP
I would like to know how to create an activator - or Trigger - in PHP but I don’t know where to start. I wanted to make the user type, for example, "nato stack". PHP would recognize the first term…
-
1
votes1
answer639
viewsString error in a Python 3 function
When I try to rotate the def gives a mistake on the part of texto[x][y-1], giving the following: erro:TypeError: 'str' object does not support item assignment Could someone please help me? def…
-
1
votes1
answer3328
viewsConcatenate string with integer
I have a variable that is a char vector, and in this vector I need to insert a number that is an integer, searching it for another variable: int quantidade; char id[3] = 'p'; For example, if the…
-
1
votes1
answer90
viewsRegular expression in PHP
Good evening, I need to receive a string via POST, and break it into keywords, but it is possible that the user separates words in three ways: comma(','), empty space(' ') or comma followed by empty…
-
1
votes0
answers56
viewsPerform a Query String
Staff have the following method and Query: mt_dispositivo = MtDispositivo .where("id_conta = 28 or id_conta = 29 or id_conta = 30 or id_conta = 36") .select('nome, data_criacao, data_atualizacao,…
-
1
votes1
answer113
viewsGet two values from a string
I’m creating a programming language and for you to define variables in it you use this code: def NomeDaVariavel = ValorDela; And wanted to know how I only take the field Nome da variável, separate…
-
1
votes1
answer86
viewsI can’t call a string
I created an algorithm that simulates a stock of a dvd sales. It stores name, price and quantity. It has some functions and it enters them, one that informs the quantity and the price of a specific…
-
1
votes1
answer350
viewshow to write a name using pointers
I need a program that uses memory heap to store any name. input we have the number of characters of the name and then the name, for example: 32 Josefina Penacho Reis dos Santos The output must be…
-
1
votes1
answer402
viewsCharacter override function does not work when data comes from mysql
I use a function to replace characters with accents or special characters, but when using the same function with data from MySQL the function is not replacing the characters. Assuming the city is…
-
1
votes1
answer1157
viewsAid on a family tree in C
Good afternoon, I need to build a family tree in c, but I only find examples with numbers that are compared, and if it is smaller than the previous one, the same is played to the left, but my doubt…
-
1
votes1
answer74
viewsHow to turn a char array into UTF-8?
For example, I have a char cadeia[300];. I put characters in it, now I want to turn it into UTF-8.
-
1
votes0
answers40
viewsPHP Gettext and strings outside the functions (strings of much use)
There is a way to put in .po strings outside the _e()? For example, hypothetically, 'real' for 'dollars'. If on a page I quote real 517 times I will translate 517 times. Instead I intend to use…
-
1
votes1
answer49
viewsGet multiple pieces of a String equal to Python
I want to make a first dimension matrix that contains the fields of a string equal each block of the Python language, example: primeiro bloco é esse isso ainda faz parte do primeiro bloco agora aqui…
-
1
votes1
answer801
viewsEncoding, bytes conversion - strings
I have a problem, I’ve been researching but all the solutions I find don’t work. The problem is that I am accessing a page (.txt) and cannot convert it from bytes for string, to be able to work the…
-
1
votes2
answers151
views -
1
votes0
answers68
viewsInvert a string from a character
I wanted a method to take a field on the side of a string and pass to the other side after the character '=', example: ColorPickerButton1.SelectedColor = My.Settings.getColorKeyword…
stringasked 9 years, 3 months ago CypherPotato 9,292 -
1
votes1
answer294
viewsHow to make the Split in some lines except specific?
I want to make a dynamic list that uses the Regex.Split separating each item by the character of a new line, except when you’re in the fields ( ... ) in my lines of code, as follows the example: var…
-
1
votes3
answers6938
views -
1
votes1
answer198
viewsHow to convert an integer to a binary string in Python 3?
If I want to convert between integers and characters, use chr and ord: >>> chr(10) '\n' >>> ord('$') 36 However I need to do a string test binary, something new in Python 3, and I…
-
1
votes1
answer1018
viewsConvert string char* to Std:string
I have the following code: void splitstr(std::string &modulo, std::string &nmodulo, int &fk) { string frase = modulo; string aux = ""; stringstream strs; for (int i = 0; i <…
-
1
votes2
answers55
viewsI cannot delete a range of words in a string
I made a function in PHP that returns the result of a POST and converts to a string using Curl. However, my code returns a lot of useless information. I wanted to manipulate the string so that I…
-
1
votes1
answer63
viewsDisplay a formatted Timespan time
I have two variables: TimeSpan horaI = new TimeSpan(10, 00, 00); TimeSpan horaF = new TimeSpan(22, 00, 00); I need to present them on the screen as follows 10:00 and 22:00. But I’m not getting it.…
-
1
votes2
answers172
viewsError in reading, strings and integers
#include <stdio.h> struct tetris{ char nome[16]; int pontuacao; }; int main(){ int i, nteste = 1, J, k, total = 0, maior, menor, pontos; while (scanf("%d\n", &J) && J != 0){ struct…
-
1
votes1
answer79
viewsString usage gives error
At the beginning of the code I declare the variable nome as char and when I try to pick up the variable nome down there in the code gives error, I’ve tried several ways and this way this down goes…
-
1
votes1
answer122
viewsFind words in a string
I am creating a PHP function that receives a string. Then he must search within that string, words inside square brackets and save them in an array. Is there a function that searches only these…
-
1
votes0
answers325
viewsConversion from String to Bigdecimal is giving error and method not saved
I’m making a system for video rental and on my category screen a field called value to save the value of my category. I was able to convert String to Bigdecimal using the following methods:…
-
1
votes1
answer213
viewsHow to improve string comparison and concatenation C#
I have the following code: private static string MontarDescricaoOrgaoUoUe(RequisicaoFisica requisicao) { return !string.IsNullOrEmpty(MontarNomeOrgao(requisicao)) ? MontarNomeOrgao(requisicao) :…
-
1
votes1
answer330
viewsConcatenate string with integer array and write to file?
I have a dynamic vector of integers. For example: 1 2 4 6 8 9 10 I want to attach it to a string, like this, for example: [B]: And record this in a row of the file, then read the file with the…
-
1
votes0
answers21
viewsWindows 8.1 App.Getresourcestream Problem
I have a problem in a method on windows phone. It reads an xml file and returns a string, the problem is that this method only works on windows 8 and not on windows 8.1. It follows the code: public…