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
votes2
answers184
viewsHow to access the name and address in the Customer Class, and access description and price in the Java Product Class, being in the Box Class?
I tried to use the following commands: // Requesting the customer’s name name = input.toString(); purchase[i]. getCliente(). setNome(name); // Código do produto a ser comprado, que é o endereço da…
-
-1
votes2
answers159
viewsC function that checks whether the whole string is lowercase
I have to pass to the lowercase function a string and check if the elements of this string are lowercase, if they are must return true, if it is not must return false, however every time I run it…
-
-1
votes1
answer89
viewsBuffer Overflow
Good afternoon, folks, I’d like to request a hand on the college ATV; About this code used as an example: #include <stdio.h> #include <string.h> int main() { char…
-
-1
votes1
answer40
viewsData conversion using Combobox
Hello, I’m having trouble dealing with an error in my program. I have two combobox inside a registration panel. When executing already appears the list of products and customers, but the code field…
-
-1
votes2
answers105
viewsHow can I turn a string into a float?
I am doing a job and I came across the following situation: I have a list with decimal numbers. But the list is like a string. For example: h = ["3,5","4,3","8,9"] Now my problem appears, I need the…
-
-1
votes1
answer66
viewsWorking with a python dictionary
I’m trying to resolve an issue in the URI, I’m going to put the description of the issue, and the link, whatever you prefer. Link: https://www.urionlinejudge.com.br/judge/pt/problems/view/1215 Andy…
-
-1
votes1
answer47
viewsIn Python, check if the contents of one column are present in another column?
I’m at Jupyter Notebook working with Python. My current dataframe is in the following format - data.Columns['name', 'filename', 'text']. All columns are string type, wish, take the 'name' column and…
-
-1
votes1
answer39
viewsHow to solve the c variable problem - string capacity, start to grow exponentially from the 3rd cycle
I’m having a problem, here with a program that aims to be a data entry routine, the problem in question, is the variable c that goes to the Cap function to ask the user the maximum capacity of the…
-
-1
votes2
answers49
viewsHow to remove ZIP code and country from a string
I’m using Javascript to manipulate some strings that comes from an API and I need to remove the zip code and country from one of these strings. Basically, I get the phrase like this: "R. Anderson…
-
-1
votes1
answer46
viewsLogical operators with different value
nome_adc_1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { double percent = (estimatedFare*0.20); double soma = estimatedFare + percent; double subtrai =…
-
-1
votes1
answer32
viewsConsult by number, age of a student
I’m doing a program where I need to consult a student(structure) who has age, name, gender, student process number. To consult for the following paramaters below, put only a little code but I need…
-
-1
votes1
answer24
viewsHow to pass string to struct within the function
Hi, I have to do a CRUD in C, but I have a problem, I have to pass 3 strings to a function but I have no idea how to do, I’ve tried everything... #include <stdio.h> #include <stdlib.h>…
-
-1
votes1
answer39
viewsHow to show Escape sequences as String in C#?
I have a C# method that takes a String and sometimes has output escapes inside, like \n. It does its function normally, which is to skip the line. But I want them to be shown as String. How can I do…
-
-1
votes1
answer27
viewsHow to clear a string for the previous value after using strcat()?
I’m using the function strcat() to concatenate string and I’m having trouble returning the string to the previous state, what I’ve tried so far is this, but with nothing successful: const char…
-
-1
votes1
answer37
viewshangman game in C++
Hi guys. I have a problem regarding a specific part of the game, which is already complete. The only problem is the condition I put to check if the word was completely guessed. My code: if…
-
-1
votes1
answer33
viewsHow to remove field to field from a String starting from left and bounded by a size desired by the user
package teste; public class RemoverStringAEsquerda { public static String removerCampoAEsquerda(String value, int tamanhoMaximoString) { int i = 0; while (value.length() >= tamanhoMaximoString){…
-
-1
votes1
answer31
viewsstring.Slice() returns empty string
I’m trying to make a system of putting words together, and I thought I’d use the .slice(). But it returns an empty string. I have already searched but no one has explained it properly. I have two…
-
-1
votes1
answer43
viewsI need to break a string that I receive and I need to divide it. This division will be given to each comma. I’m getting him to recognize the comma
What I’ve done so far is this: #include <stdio.h> #include <string.h> int cont = 0; int pos[6]; char buffer[107] =…
-
-1
votes2
answers44
viewsStore words in a "char" vector
I’m trying to make an algorithm that returns the region of the CPF that was informed, but I’m bumping into the character limit that a variable of the type char allows in C language. I tried to…
-
-1
votes0
answers15
viewsMount a string with user-delimited size and can be parsed character by character
I need to keep several names (compounds) of different people, so that I can return to the user the first letters of each name, and the last name of each person. That’s what I’ve done so far:…
-
-1
votes1
answer18
viewsC - String comparison with strcmp does not work
Guys, I’m trying to compare a string entered by the user in a dynamic array of strings with a predefined string. In the DO-WHILE loop the repetition should end as the string the user enters for FIM,…
-
-2
votes1
answer3816
viewsConcatenate strings in Javascript
I have the following function, which changes the numeric value of a string when found: var original = "Este aqui é o valor do cliente 000.000.00 01"; var original = str.match(/\d\d\d\.\d\d\d\.\d\d…
-
-2
votes2
answers1120
viewsHow to compare only part of a Java String
String str = new String("Bruno Oliveira"); String str2 = new String("Gustavo Oliveira"); System.out.println(str.equals(str2)); //retorna false How to compare only certain part of a string?…
-
-2
votes1
answer98
viewsHow to insert an instruction into the array only if it is true?
I need to somehow verify if there is any element within a given array and if there is, put a whole string in a specific place. For example: I need to check whether $categoria is not empty $categoria…
-
-2
votes2
answers360
viewsHow to convert a date (string) to another format using Javascript?
I have the following string: 2016-06-08 - 10:08 I need to convert this string to the other format: 08-06-2016 10:08 How should I proceed? function dateFormat(date) { inputFormat = new…
-
-2
votes1
answer208
viewsProgram.exe has stopped working
I’m doing a program that captures a person’s full name and reproduces it in this format: surname, surname without surname (EX:João Carlos Cunha -> Cunha, João Carlos. Amanda Batista ->…
-
-2
votes2
answers124
viewsRemove half of the file name
I have a page to pick up a path, which is the Folder Browser Dialog and the path that is saved is like this : "C: ana Updates 2017 2017_04\" I wanted to go through the path, save only the result in…
-
-2
votes1
answer1107
viewsWhere is it used and what is the importance of string type?
I’m starting to program, but I wanted to know more about the value and importance of the type string programming. In general: Some general aspects of the type string? A little about their use, where…
-
-2
votes2
answers3257
viewsHow to remove a part of a string?
I have a text saved in a string and need to copy a part of that text to find a certain word in it. Ex. I need to remove my name and my age from this text, I know they always come after : and in…
-
-2
votes2
answers136
viewsScan more than one string
In C I can scan more than one string as is done with integers? Type: scanf("%s %s", pal1, pal2);
-
-2
votes1
answer157
viewsComparison of elements of a vector with "strcmp()"
In the following function I want to compare the elements of a array of 1000, but I can’t find a way to successfully compare them, even using strcmp(). void verifica_conta(int *ptr) { int i;…
-
-2
votes2
answers452
viewsString comparison in C
How could I print the variable sex outside the if-else (has to be outside of it). This code is printing blank and I can’t understand why. #include <stdio.h> #include <stdlib.h> #include…
-
-2
votes3
answers1916
viewsHow to replace vowels with @
I’m doing a college task that asks for a program where the user type the string [20] and I return to it the string reversed and with the vowels replaced by @s. How do I do it?
-
-2
votes2
answers3763
viewsCount letters and pick initials of the name
The program does not print the first letter of each name. nome[i]=nome[i+1]; I need to make a program that enters the name of the person, tells how many letters A has the name of that person and…
-
-2
votes2
answers5608
viewsCount how many times each character appears in a string (no function use)
I’m having the doubt in a matter of string exercises that I’m doing. The question is this below: Write a program that reads a string and prints how many times each character appears in this string…
-
-2
votes1
answer66
viewsSome test that this code does not pass
I’m asking the question Voice Dial, I’ve done every test possible and can’t find the error could help me in other test that my code fails My code #include <stdio.h> #include <string.h>…
-
-2
votes1
answer49
viewsHow do I accept only letters in the Ruby entry?
Given a string, you have to take only uppercase and lowercase letters. And in the output show them. How can I achieve this result?
-
-2
votes1
answer116
viewsConvert Cell to String type in Apache POI
How can I convert a guy Cell for String ? String datateste = row.getCell(5);
-
-2
votes3
answers425
viewsReplace Space by Comma
$var = 123 456 789; I need the value of this variable to stay: $var = 123,456,789; Or add a comma after the number: $var = 123, 456, 789; I tried so: str_replace($var," ","")…
-
-2
votes2
answers335
viewsHow to insert space in Camelcase string?
I’m looking for a way to separate string from an array object, coming from an API, for example: Pageviews, get Page Views, I’m using VUEJS.
-
-2
votes1
answer604
viewsSeparate a single string in an array of strings
In this code I am trying to make a string read and then put each word separated by space in an array of strings. I saw that in some cases the Strtok function is used, but since I intend to use these…
-
-2
votes1
answer226
viewsProblem with strcpy
I’m trying to fill in the fields of a struct with strcpy but I’m not getting the expected value, as for example: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include…
-
-2
votes4
answers474
viewsGrab part of a string
How do I get just up to the , of the following string: Ninguem ninguem, todos Expected result: Ninguem ninguem
-
-2
votes2
answers47
viewsHow to pick up a word that contains a specific character?
I have this string in a div: "Sofá 3 Lugares Tiffany em Veludo 2,12m Aquila" I want to take the text of the words that contain "," and return them. Ex.: 2.12m…
-
-2
votes3
answers776
viewsUse of length to count concatenated strings
I need to solve this exercise but it is appearing with error. function tamanhoNomeCompleto(nome, sobrenome){ return nome+ " " +sobrenome.lenght } in the case, the parameters have to appear for…
-
-2
votes1
answer805
viewsBasic Javascript - how to remove a comma from the string
I have a question that is consuming me here concerning this little piece of code: let word = "APPLE" //CONVERTED TO ARRAY let res = word.slice(3,5) //RES = LE let res1 = res.split("") //REVERSE THE…
-
-2
votes2
answers89
viewsI want to concatenate two string , but with space between name and surname
Exercise 3 - Create two strings and concatenate the two into a third string name = 'alecio' surname ='Martins' integer name = name + surname print(integer name) aleciomartins
stringasked 4 years, 7 months ago Alecio Martins 1 -
-2
votes2
answers81
viewsConcatenate string of variables
I have a problem, I need to concatenate some variables here in PHP and they are strings, but the problem is that they are inside "ifs" so when it is not set, it says that the variable is Undefined…
-
-2
votes1
answer24
viewsInclude in a variable url conunt javascript 'console' Chrome
var account = 1 var account = 1 + 1 window.open('/test/number/11965/', '_Blank') I need to replace the value of 11965 by variable account so that it remains window.open('/test/number/COUNT/',…
-
-2
votes1
answer213
viewsSpring data Jpa Lanca @Autowired error and null pointer error
I’m using Spring Tool Suite to make an application, but when I try to release the website’s html data to the database, the relative service method will save and generate persistence returns…