Questions tagged as 'string'

1
answer

Check if all items in a string are different?

How can I check if all items in a string are different? For example: x:"abcdefga" = False y:"abcdefg" = True Since x[0] == x[7] , then it would be False . But in this case I would use this condition in if . Is th...
asked by 02.05.2017 / 01:37
1
answer

How to create string vectors in java?

   "Make an algorithm to receive an integer n (number of students), an integer m (number of subjects), and nxm grades 0 to 10, which each student obtained in each discipline.       a) which (s) of course (s) students scored highest on average?  ...
asked by 29.11.2014 / 20:45
3
answers

How to extract a word from a URL in PHP

In these examples below:    + bbbbbbb2.virtua.com.br - take the virtua   + 000-74-4-000.paemt702.dsl.brasiltelecom.net.br to take the brasiltelecom   + 111.222.22.222.dynamic. adsl.gvt. net.br - take gvt I've tried: $texto = "189-72-5...
asked by 29.10.2014 / 20:44
2
answers

How to remove spaces at the beginning and end of a string?

How to remove any number of spaces at the beginning or end of a string in C #?     
asked by 03.05.2015 / 18:13
3
answers

How to 'break' a text at each character range - Javascript

I would like to know how to 'break' (split function) one text every 8 characters in javascript for example: var teste = '1234567898' teste.split({a cada 8 caracteres}) //retorna ['12345678', '898']; Thank you in advance.     
asked by 18.12.2014 / 19:57
2
answers

How to convert Lowercase String to UPPERCASE?

My question is in switch (opcao) . To perform one of the cases it is necessary to enter UPPERCASE letters. There is some function of converting strings or characters in Java from lowercase to uppercase as in C ( tolower and toupp...
asked by 20.10.2017 / 17:27
1
answer

Using Concat to concatenate array of strings

I was looking at strings and that they are immutable and can not be added to them in pain under penalty of being too slow. The recommendation is to use StringBuilder . But I also saw that there is a version of Concat () that accepts...
asked by 20.03.2017 / 14:45
2
answers

How to map and get only one property or field of a query?

I'm using Dapper to map object properties . See a practical example: var servico = conexao.Query<Servico>(statement.ToSql(), new { IdServico = id }).First(); That is, the Servico object will have all its properties mapped a...
asked by 29.01.2017 / 16:07
3
answers

How to get a text from a QLineEdit in Qt?

For example, I have a LineEdit , when I push a button I want to get what I wrote in this LineEdit and store a QString .     
asked by 20.04.2015 / 12:30
2
answers

Simple Quotes vs. Doubles in PHP Regex

Considering that I have a path which I want to check with preg_match if it is the desired path, what is the difference between the two following operations? // Single quoted string preg_match('/\/path\/to\/folder\//', $path) //...
asked by 18.10.2016 / 14:38