Questions tagged as 'string'

2
answers

Convert.ToString () and .ToString ()

Are there any glaring differences between them? Whether in performance or ways of treating, what are their particularities? What would be the correct way to use it (if there is any difference)?     
asked by 06.04.2016 / 20:03
3
answers

String Search

I have a dynamic size String and need to search the "#" all characters until the next blank space. I tried to use split, but without success. String texto = "oi tudo bem como vai #01?"; String[] t ; t = texto.split(texto);     
asked by 18.04.2017 / 16:36
2
answers

Why is my function concatenating instead of adding the numbers?

I'm learning JavaScript and I'm breaking my head with this code I created. Why is my function concatenating instead of adding up the numbers I store in variables? <!DOCTYPE html> <html> <head> <title>Aula 05 Java Sc...
asked by 30.04.2016 / 21:55
3
answers

Multiple lines of text or code with the ".html ()" method

When using the jQuery .html () method to apply multiple lines of text or HTML code to an element, it fails with error: Example in JSFiddle $(function(){ $( '.qualquerClasse' ).html( ' conteúdo de 3 linhas de código: uma...
asked by 04.02.2014 / 03:27
3
answers

How to write multiple rows in Python?

How can I write a string with multiple lines in Python? As I come from PHP, I usually do this: $string = " uma linha outra linha2 " Or: $string = <<<EOT uma linha outra linha EOT; When I try to do this in Python, it...
asked by 13.08.2015 / 14:47
3
answers

Picking up part of the phone

At registration, the user registers his phone and this field is masked (99) 99999-9999 and this is saved in the BD. if I want to use only the DDD of this, and the numbers separated, how should I proceed? in case I wanted DDD 99 Number 999999999....
asked by 03.11.2016 / 03:19
3
answers

Insert data from a string into a table

I have a text file that I read and set it to a string texto so that it looks like this: {nome="Cassio",sexo="M",idade=19} {nome="Paula",sexo="F",idade=20} And I used the following code to add each line of that string to a position i...
asked by 03.05.2014 / 18:43
2
answers

What is the difference between 'string' and r'string 'in Python?

I was looking at the code in Django, framework in Python, and I came across the following code in the file urls.py . urlpatterns = [ url(r'^articles/2003/$', views.special_case_2003), url(r'^articles/([0-9]{4})/$', views.year_a...
asked by 13.08.2015 / 14:29
2
answers

Invoke method of an object - reflect

Is it possible to invoke a method from a content of a String variable? for (Object vlr : dados) { String metodo = "getCodigo()"; contato.setAttribute("codigo", vlr.metodo); }     
asked by 24.09.2015 / 20:15
2
answers

Algorithm in C to convert arabic number to roman number

How to do this conversion? It does not have to be the algorithm ready, I wanted a help at least in logic.     
asked by 26.05.2014 / 00:41