Questions tagged as 'string'

6
answers

Check if a String contains two words

I have a problem with this exercise here: Write a class that does data validation ( Validacao ), with a method to validate a proper name ( ehNomeValido(nome) ). The method should return true if it passes the following rules...
asked by 02.07.2018 / 22:10
4
answers

Divide a string with empty spaces

I'm trying to split an entry of the following type: 1444771699,Andre Alves,SAQUE,-500.00,,200 I'm trying to use strtok , but it ignores empty space. Any idea how to split the string without ignoring the space?     
asked by 02.11.2015 / 18:22
3
answers

Remove non-numeric characters from a string

Example: I have the following string    "M1245D454" I need only leave the numbers on it. M and D, are examples, I want to remove any non-numeric character. Is there any function in C # or VB.NET for this?     
asked by 14.04.2016 / 21:35
3
answers

How to compare strings in case sensitive?

I have following code: Usuarios user = DataModel.Usuarios.Where(x => x.Login.Equals(login,StringComparison.OrdinalIgnoreCase) && x.Senha.Equals(senha,StringComparison.Ordinal)).FirstOrDefault(); I would like to get the following...
asked by 13.10.2017 / 05:54
2
answers

How to cut a string?

Example: nome = "Josénildo da Silva Ramos do Carmo"; Cut to have up to X characters, thus: nome = "Josénildo da Silva "; In the case I cut it to 20 characters. How do I do this in C #? I only know in C (which is vector). In C # I...
asked by 14.07.2015 / 01:35
1
answer

What is the difference of Integer.valueOf () when using String or int parameters?

Why are the results of System.out different in the lines below? Integer teste = Integer.valueOf("0422"); Resultado: 422 Integer teste = Integer.valueOf(0422); Resultado: 274 If you pass a int it changes the original value, no...
asked by 17.09.2014 / 16:15
3
answers

Change the format of a date (time) that is in a String

I have two strings that receive hours, in this case, ArrivalTime and DepartureTime. The next format is HH: MM: SS. I would like to format this string for HH: MM how can I do this? I enter this text in ToggleButtons (setTextOn and setTextOff)....
asked by 20.10.2016 / 18:54
3
answers

How to convert an int number to string in python?

I need to do an exercise in which I ignore an integer variable of 3 digits and python has to show it inverted, but until where I know an integer variable can do that, but a string yes. What can I do?     
asked by 23.03.2017 / 19:15
2
answers

Behavior of malloc (1) in C

If I use char *char_commandout = (char *) malloc(1); , the allocated byte will store "\ 0" at position 0 of the vector or it will allocate a space for the value that I want to store (at position 0) and one for "\ 0" (in position 1)?     
asked by 19.06.2018 / 04:31
2
answers

What's the difference between using toString () and JSON.stringify ()?

var arr = [1,2,3]; arr.toString(); // "1,2,3" JSON.stringify(arr); // "[1,2,3]"     
asked by 02.10.2018 / 01:25