Questions tagged as 'string'

2
answers

Values returned in comparison of strings in C

I was reading about header string.h functions in link and I came across with a strings function (very useful after all), such as strcmp(string1, string2) . Depending on the first character that does not match, that is, it i...
asked by 03.08.2018 / 23:26
3
answers

How to sum the numeric values inside a String in C?

For example, if the user types 123456789 the program should print 45 ( 123456789 ). 1 + 2 + 3 + 4 ...) . I think the easiest way would be to store the number in a string and then add the elements in each position of the string, but I do not k...
asked by 11.09.2017 / 15:50
1
answer

Matrix with strings in Visualg

I'm having difficulty with the following question:    Create an M matrix [21,10]. Read 10 names (maximum 20 characters) and store in the first row of the array. After reading, decompose the names letter by letter and store them in the other l...
asked by 23.05.2017 / 21:19
1
answer

Strlen problem

Can anyone tell me why this code is printing an extra number when I initialize the variable as "0": #include <stdio.h> #include <string.h> int main ( void ) { char texto[50]; int cont = 0; printf("\nInforme seu nome comp...
asked by 06.10.2016 / 21:20
5
answers

Capturing dates of a text using regular expression in javascript

I have a function that returns data in JSON and places it in certain places with jQuery. One of these data is text that contains a date range (Start and End). Example of returned text: ESPÍRITO SANTO - Status: This is how much the Brazi...
asked by 11.03.2014 / 19:15
4
answers

How do I know if the first character of a string is uppercase?

I need to know if the first character of a string is uppercase and does not let the program follow. How to do it? Console.Write("Digite o nome do " + i + "º rei: " ); kings[i] = Console.ReadLine(); while ((kings[...
asked by 10.10.2018 / 21:20
2
answers

How to remove the value of the last position of the TextBox with the Substring?

How to remove the value of the last position from TextBox with Substring ? Suppose TextBox gets a value with this mascara = 0.00% , however, I just want to save the numbers, not the percent, how do I do it?     
asked by 02.10.2017 / 16:04
2
answers

Slicing strings from right to left

I have a column in the database with the name of codigo , in which the formatting looks like this: 18000001 Where 18 means the year we are and 1 is the code for each result. Knowing that this code can be greater than 1 I type 1...
asked by 07.05.2018 / 15:10
1
answer

String Validations

I've been researching how to validate e-mail, dates, hours, etc. And in the case of email, I found a code like this: /^.+@.+\..{2,}$/; . He is incomplete. But I wanted to understand what these symbols are, and what do they represent to val...
asked by 28.05.2016 / 04:39
1
answer

Remove spaces via Update

I have a field called titulo , in the noticias table. Unfortunately, due to forgetting PHP's trim command, it has several titles with space at the beginning and end of the string . How can I via SQL (MySQL) update the titles...
asked by 22.03.2016 / 16:01