Questions tagged as 'string'

3
answers

Separate small strings from a giant string

Hello. I have to do a function to read a huge string and then break it down into small strings for each field. Each field would be separated by ; example: BRUNNY;PR;MG;T;Câmara dos Deputados, Edifício Anexo;4;, gabinete nº;260;Brasília...
asked by 13.09.2017 / 01:51
1
answer

Date parser in C

I was doing tests to do parsers of date and I made this example based on a program that formats through sscanf() with a constant string defined because I did not understand well where is the error: #include <cstring> #include...
asked by 25.07.2017 / 20:28
2
answers

I'm having trouble reading a string inside a function

Good night, I would like to know methods to read a string in C (Version C99), I already tried a lot, and it does not work, below, the defective code. Note: The error I am reporting is that shortly after pressing "ENTER" on the first 'gets'...
asked by 05.07.2017 / 00:26
2
answers

error converting string to float in python

Hello, I'm having a problem I'm not getting conveter string for float The program takes the price of a game dps converts to string and positions through the character and I am not able to convert price =game.find(attrs="col search_price d...
asked by 11.06.2017 / 23:22
1
answer

printing memory garbage

This program should load words from a txt file into a vector, draw 10 words, place them in vector and then print on the screen. The problem is that it is printing memory garbage and I do not know how to solve this problem. How to solve...
asked by 23.06.2017 / 13:38
1
answer

How to replace a middle character of a string and change it by two characters?

For example, Char s1 [ ] = "azul"; Char S2 [ ] = "z"; Char S3 [ ] = "PP"; Puts(s1); //azul Code to replace ... Expected result: Puts(s1); //aPPul Note: I have been able to do this by changing 1 character by another, but by 1 by 2...
asked by 18.06.2017 / 21:40
2
answers

Array returns wrong value in java

I have a question about a college job. I can read with numbers, remove the ";" and pass the values to the array while reading the file. However, when I try to access an array position outside of the file read, it does not return the value I have...
asked by 08.06.2017 / 01:17
3
answers

Remove last character from a string, when the character is a blank space [duplicate]

Good afternoon. I'm programming in java and I want to get the initials of a name, in case: "Jonas Barros Santos" You have to see: JS The code I use does this, but if the person puts the name with space at the end, my code does no...
asked by 09.05.2017 / 18:30
2
answers

I can not apply Encoder in the text to correctly appear "ç, accents, other special characters"

Hello, I need to collect information from the station, and I'm getting it. But in the received text I can not apply an Encoder to appear the special characters correctly: I'vetriedusing"ISO-8859-1", and other forms of encode too string...
asked by 28.04.2017 / 19:25
1
answer

sprintf does not give the expected result

I have variables of type Unsigned Long Int and would like to save its value in string , to perform checksum and send via serial communication.     void Payload (int long unsigned lastTime, float deltaOne, float deltaTwo, int factor...
asked by 16.02.2017 / 12:36