Questions tagged as 'string'

1
answer

How to concatenate using StringBuilder?

I have the following method toString of a class public String toString(){ return "Solicitud [idSolicitud=" + idSolicitud +", numCifra=" + numCifra +", usuarioBD=" + usuarioBD +"]"; } and what I want is to concatenate with StringBuilder...
asked by 12.07.2018 / 20:04
1
answer

How to count the times a string is repeated in another string in C #?

I have a string, for example: string cadena = "ABABBA"; and I want to know how many times the letter A is repeated next to the letter B , in the example I put in it I should result in 4 . I had thought to use a for to traverse the...
asked by 02.03.2018 / 20:38
3
answers

How do I multiply a string by N times in javascript?

Good evening, I have a question, I need to enter a number in javascript print it in the console for the amount entered. For example if you want the string to be an asterisk "*": If I enter a number 5, the result should be: *****. Something th...
asked by 25.05.2017 / 07:48
2
answers

How to show in JOptionPane, a tribute of an enum

I'm using enums and JOptioPane, and I want to show the enum attribute, (I mean a string), this is what I have: public Cities readCityOrigen() { Cities [] listCityOrigen = Cities.values(); Cities city = (Cities) JOptionPane.showInputDia...
asked by 22.10.2016 / 03:55
2
answers

Help, compile error using string inside a switch in c ++

I greet you, I just started to program and I find this problem "[Error] 'binary1' was not declared in this scope" is a string inside a switch, a string seemed outside the switch works for me, but not inside , if you can help me. The code is not...
asked by 18.05.2016 / 10:11
1
answer

Convert a string to a signed number

I need to convert a string with the following format -0.0092 to a number type with which I can operate later, I have tried with Val, or CdBl and both lose the sign or truncate the final result ...     
asked by 04.10.2018 / 11:16
3
answers

Identify an anagram

I'm doing an exercise and I need to identify an anagram. More or less I have it, but it fails me, because I do not correctly identify the capitals of the lowercase letters and this I do not know very well how to do it. I have defined a method...
asked by 29.12.2016 / 15:42
2
answers

separate string in each capital letter or number

I need to separate a string with "_" every time it finds a capital letter and transform it to lowercase. This to separate each word from the class name, for example if I have the following class: class UserNote{ } the name of that class wou...
asked by 13.03.2018 / 18:32
1
answer

parseInt from string to number in javascript

Syntax parseInt(string, base); Why does that numeral return? parseInt("FXX123", 16); // retorna : 15 I understand that when the base is 16, it is used from A to F, because in the example it uses X and what is its value? And in w...
asked by 22.03.2018 / 00:41
1
answer

Doubt about indexOf () in string

please if you could give me more detail of why the return of each exercise: "Blue Whale".indexOf("Whale",0) // returns 5 "Blue Whale".indexOf("Whale",5) // returns 5 "Blue Whale".indexOf("",9) // returns 9 Thank you.     
asked by 21.03.2018 / 03:52