Questions tagged as 'string'

4
answers

How to split a string in C ++?

I received this simple (I really thought it was!) challenge of creating a "tokenizer". I had to split string " O rato roeu a roupa do rei de roma " into spaces. So, after a long time, I developed the following algori...
asked by 03.03.2014 / 20:31
2
answers

Find words between characters {}, and remove from text in PHP?

$comoesta = "{A,O} {portador,portadora} é o mais {especializada,especializado} para o serviço ."; If it's masculine: $comodeveficar = "O portador é o mais especializado para o serviço "; If it's feminine: $comodeveficar = "A portadora...
asked by 17.01.2017 / 13:08
4
answers

How many strings are created in the codes below?

How many String s does the JVM actually create during the runtime of the code snippets below? 1 : String s1 = "s1"; 2 : String s2 = new String("s2"); 3 : String s3 = "s3"; String s4 = s3 + "s4"; 4 : String s5 = "s5...
asked by 21.02.2017 / 18:17
2
answers

How to get a loose number in my HTML?

Consider the following code: <span class="test"><span style="color:green">Teste</span>:</span> Text<br><br> <span class="test"><span style="color:green">Mais</span>:</span> Text<br...
asked by 22.04.2014 / 00:49
1
answer

Concatenate Strings in Java Loops - StringBuilder or '+'?

Java allows us to concatenate Strings in Java using just the '+' operator String str = "a" + "b" + "c"; It's a simple way to do the job, and much less verbose than using StringBuilder. But in cases of Loops like the one below, which appr...
asked by 27.06.2015 / 14:53
1
answer

How, when and why to use "SecureString" in C #?

I once heard about the C # SecureString class and found it interesting, so I think it's interesting content that can yield good answers from more experienced professionals. Some questions to ask might be: Someone has worked with this cla...
asked by 09.11.2016 / 18:06
1
answer

What is the difference between the replace () and replaceAll () methods?

I was reading the documentation to properly develop a mask and save without it. However, I came across this question about methods replace and replaceAll for my string . What's the difference between the two, apparent...
asked by 03.04.2017 / 14:53
2
answers

Why are some string methods static?

I'm learning C # after already working with other languages, I noticed that some methods need to be called by the class string.Concat("123","456") I usually use it in other languages this way "123".Concat("456") Why can not you? Can...
asked by 13.03.2017 / 13:29
1
answer

Retry user and password attempts

I wanted a program that checks the user and password, if it was correct to display a message, if it repeated the check and if the attempts were equal to 3, it showed the limit message of attempts reached. #include <stdio.h> #include <...
asked by 02.05.2016 / 13:32
4
answers

Separate letters from String numbers

I need to separate the characters of a string into numbers and letters. Ex: Entry:    "A1B2C3D2Z9" Output: List<Character> numeros = { '1','2', '3' } List<Character> letras = { 'A', 'B', 'C' } I use a for to...
asked by 09.02.2017 / 17:04