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
votes0
answers23
viewsHow to select a text within a string using php
I am using PHP. I would like to select a name or several according to what is passed in a string, and return that selection in bold. Ex: This code already returns my name, but only if it is a…
-
0
votes1
answer24
viewsHow to check if a phrase/string contains words from a list in Kotlin
I’m having trouble with the operator in, when I have only one operating i can easily verify if a certain word is contained in a list, for example: fun main(){ val cores = listOf( "branco", "azul",…
-
0
votes2
answers90
viewsPrintf() showing strange characters
The purpose of the code is to show all substrings of the variable firstString that has the same size as the second string that is the variable secondString. However, when I use the printf("%s\n",…
-
0
votes1
answer45
viewsList Deletion and Return
Will be passed as entry list with the current information of a contact, and the phone you want to delete: • if the phone is in the contact’s phone list, it must be removed. • if not, no update will…
-
0
votes0
answers25
viewsRemove characters from a String (or generate a new one without them) that are between two special characters
I need some help in this case, I have a string and I would need to remove some characters from it. String minhaStr = "{"abcde{"fg":"hij"}" I need to remove everything between the keys {, ie in this…
-
-1
votes1
answer296
viewsProblem with string alignment
I have a problem in my Android project that I am not able to solve. I have a series of strings that are summed to form a larger string as the following example: String teste1 = "O.P. Processo…
-
-1
votes2
answers1016
viewsRegex | Take group split
This tag repeats by changing the content and I would like to know if there is a way to get each content separately TextBox TXTTESTE = new TextBox(); TextBox TXTTESTEDOIS = new TextBox(); TextBox…
-
-1
votes4
answers409
viewsHow to transform, for example, "0" to "ZERO" in C? What problem in this code?
I have to do a program for college whose main objective is another, but in one of the stages of the program, I need to pass two integer random numbers from 0 to 9 for their extensive written…
-
-1
votes2
answers457
viewsCheckbox concatenating string several times
I wanted to click on checkbox and then register, save the default value and service name in the database (description). However, the description is a problem for me, because when the user marks and…
-
-1
votes1
answer50
viewsReceived Webresponse String Editing
I receive information through responseStreamReader.ReadToEnd().ToString();. But before displaying it on the User screen I want to edit it. How to proceed?
-
-1
votes1
answer1040
viewsScript to swap a character for an asterisk in a string
Hello! I need to make a program that reads a text (string) typed by the user with a maximum of 500 characters, and print this text by replacing the first letter of each word with an asterisk '*'.…
-
-1
votes2
answers126
viewsStd::out_of_range error when using substring C++
I have a file txt containing the following type of information on each line: Example: John-88888888 I need to read every line of that file and separate the name in a variable and the number in…
-
-1
votes1
answer707
viewsHow to pick specific letters from a string - Swift2
How do I get one letra specifies a variable? var variavel = "teste"; I’d like to take a letra separada, I need to put each letter in a different variable Thank you!…
-
-1
votes1
answer1017
viewshow to resolve accent errors when sending an Android message to a php API
Guys, I’m having trouble sending strings with accentuation and strings with 2 lines or more. When sending without accentuation or and with only one line it normally accepts, however, when sending…
-
-1
votes1
answer709
viewsExtract existing value between two regular expression tags
How to check from a regular expression whether there is a certain value between two strings, for example, tags <code> and </code>? I want, for example, to know if there is between the…
-
-1
votes2
answers171
viewsAdd a char on a char pointer in C/C++
I need to add a char on a pointer of char. For example: I have a pointer of char called name, which receives "log", after the process, I want it to be "log1". I tried to implement it like this, but…
-
-1
votes1
answer1359
viewsReplace wrong words in a Text Box
I wanted an idea of how to create something of the type, text field, where we type some wrong word(s) and soon is corrected(s). For example: <body><input type="text" id="exibir"…
-
-1
votes2
answers159
viewsI can’t keep the string
void ex51(char *nome_ficheiro){//escrever e criar um ficheiro novo. char frase[100]; printf("Introduza o texto que quer escrever neste ficheiro:\n"); scanf("%s",frase); FILE…
-
-1
votes1
answer417
viewsHow to extract sentences from a text in Java?
I recently read an article that analyzed the size of the sentences of several authors. It was a stylistic study of his works. How do I read a text (with several paragraphs) and extract your…
-
-1
votes2
answers2149
viewsHow to detect the largest word of a string in C?
I came across this problem during a personal project, it is more curiosity really, I would like to ask anyone who can give me a light on this, because I have solved the problem in other languages…
-
-1
votes1
answer71
viewsHow to get a correct value using the point?
preco_casa = float (input("Qual o preço do imóvel?")) seu_salario = input("Qual o seu salário mensal?:") anos_a_pagar = input("Quantidade de anos a pagar pelo imóvel:") valor_prestacao = preco_casa…
-
-1
votes4
answers166
viewsC# WPF How to separate a long string into several positions of an Array?
I need to create a getter and a Setter for 14 Model properties that will be used to make Binding in Xaml. The properties come from here: I have a field from a database table where it loads a very…
-
-1
votes1
answer805
viewsCopy string to struct
While trying to copy String nome into String in Struct novo->nome the program stops working if I comment on the function strcpy(novo->nome,nome); the code is executed normally. //Função de…
-
-1
votes2
answers3475
viewsReturn last characters from a string in PHP
I’m trying to incorporate some financial information from Infomoney into my application, and in the Investment Fund part it gives the ranking of the main portfolios. Only it returns the following…
-
-1
votes1
answer234
viewsFormatting a PHP string in UTF8
I have in a $variable the following content: I would like the words "metallic" "plastic" "dimensions" to be normal. What should I use?…
-
-1
votes2
answers1299
viewsHow to format a Double by swapping a semicolon and keeping 2 decimal places in VB.NET
I need to transform the result of a value of As Double for the Brazilian numerical standard that uses comma instead of dot (and also maintain only 2 decimal places), thus: ' variaveis de teste '…
-
-1
votes2
answers861
viewsProgram in C, how to print the word without the character?
I can’t print the word without the character and I have no idea how to execute the ending. if anyone can help follow what I’ve done: #include <stdio.h> #include <string.h> int main() {…
-
-1
votes1
answer54
viewsWhy are the string characters being printed as integer numbers?
I have to analyze a code snippet and explain how it works, but I can’t figure out the output: Code: word_norm = 'mundo'.encode("utf8").lower() for idx, value in enumerate(word_norm): print(idx,…
-
-1
votes1
answer248
viewsSubstitution of specific words
I want to create a code in PHP in which the user type for example "pedro went to the market" he replaces in some registered words like change the silaba "mer" for copper and the silaba "was" for…
-
-1
votes3
answers1148
viewsHow to concatenate strings without using a function?
Good afternoon guys, I have this question. How do I concatenate two strings without using function or library for this?
-
-1
votes1
answer6223
viewsHow to use quotation marks inside quotation marks and exchange words inside the argument?
Rotating the os.system("reg add "caminho\caminho\caminho\caminho\"") and if you can do more, you have a way for me to pick a word in the middle of that command and replace it with another??…
-
-1
votes1
answer210
viewsHow to verify that vector fields are null?
I am building a program, which should initially check whether the array of type (Class) is null. My class has the get and set method, as well as the constructors with and without standard. However,…
-
-1
votes1
answer89
viewsI need help on this competitive programming issue
I’m asking the question Low Frequency I have tested the cases of Udebug but the online judge only returns me Runtime error, for what I know when this happens and when it tries to use memory position…
-
-1
votes3
answers409
viewsSex selector on if parole
How would you do in this code to catch the sex of the person and display on printf()? I’ve seen many activities where in the condition of if, if he used too many numbers and hit me a question: And…
-
-1
votes1
answer1260
viewsRead char and string in c++
I have to put an integer, a real, a character and a sentence containing spaces up to 100 characters. I tried to make the solution but, I can only type the numbers and it is not leaving the character…
-
-1
votes2
answers41
viewsDoubt about functions in php
A function only works if we call it in some file or it will work anyway? For example, to pass the value from one variable to another in the processing file, I know I must call the function to give…
-
-1
votes1
answer49
viewsError obtaining time with Row.getCell()
I’m getting data from a spreadsheet in excel. public void Hora() Cell horaAgen = null; if(row.getCell(7) != null ){ horaAgen = row.getCell(7); System.out.println("hora: "+horaAgen); } } On the…
-
-1
votes1
answer50
viewsHow to find repeated character blocks within a string?
I am doing a college job and in order to continue I need to take a message that has been given and find out if there are repeated blocks of characters inside that message and which is the block.…
-
-1
votes1
answer80
viewsWhy is my string not converted to lowercase?
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> /* Lucas Correia Síntese Objetivo:Ler o nome de duas…
-
-1
votes3
answers1432
viewsConvert Double to Integer
I would like that in the TextView where the value of "trees to restore" appears without a point or zeros. In the situation below appears "180.0000000" and should appear "180". Is he the type Double,…
-
-1
votes1
answer218
viewsPython - Strings and files
I’m starting to learn Python files. What suggestions would you give to improve the code and make it more beautiful or smaller? """ A ACME Inc., uma empresa de 500 funcionários, está tendo problemas…
-
-1
votes1
answer157
viewsString Arrays
In a "use java head" book exercise, it asks to declare 3 string arrays, but when I put the code in the ide it gives an error of incompatible string types to String[] someone knows why??? package…
-
-1
votes2
answers1195
viewsHow to "break" a pure C string to assign the parts to other variables?
I’m doing a thing for college and I’m lost to use C because I learned to code in Python. It’s a simple question: If I have a str string, how can I "break it" into another 3 to assign to three…
-
-1
votes1
answer68
viewsHow to Assign a Phrase to a line in a chars matrix?
I want to modify standard phrases from a theoretical game. For example, the game has the phrase "Choose a command" and, over a given state, I would like to exchange all letters "o" and "a" for a @.…
-
-1
votes1
answer129
views -
-1
votes1
answer169
viewsPixel size of a Python String
I would like to know how to make a code in Python that checks the size of a string (in pixels). Guess: we have a string 'ALCON BOTTON FISH 50G' I would like to know what its pixel size to center in…
-
-1
votes3
answers2058
viewsAlways pick the last three characters without knowing the size of the string
I want to get the last three characters of a String. Example: String x = "OlaMundo" Exit: ndo I can even do it using substring, the problem is I don’t know the size of the String, I don’t know what…
-
-1
votes1
answer75
viewsSomeone experienced who understands string manipulation well, who can help with this error
Good morning, I am presenting a problem that I have no idea the reason, I have tried to ask other people, none discovered the real reason for the error and how to repair it. Good my teacher, asked…
-
-1
votes2
answers651
viewsNormalize or other way to format String
I have this method: public static String trataNomeArquivo(String nomeArquivo) { return Normalizer.normalize(nomeArquivo, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "").toUpperCase(); } She…
-
-1
votes4
answers519
viewsRemove last space from a variable
For example: $name = 'Fulano De Tal '; How to remove that last space, to look like this: (Fulano De Tal) ?