Questions tagged as 'string'

3
answers

What is the difference between parseInt and + operator before a string?

I've seen a colleague converting a string to integer using the var a = +"10" f syntax but I've always used parseInt() and the line is usually var a = parseInt("10") . Why putting the + operator before a string happens,...
asked by 01.10.2018 / 14:41
2
answers

"Variable system" with regular expressions

I have a file something like this: %usuario: 'Anônimo' Olá <b>%{usuario}</b> (This is just an example and is not the real case), but I think if I were to explain the real problem it would give me a lot more work to understand, s...
asked by 11.04.2014 / 16:46
1
answer

What is the difference between carriage return and line feed?

There are two different ways to break a CR (carriage return) line and LF (line feed).) What's the difference between these two? When should one use one or the other? Does it depend on the system? From the language?     
asked by 20.10.2015 / 14:48
1
answer

Compare Strings by non-value format

I have a format of String , for example: xxxx-xxxx-xxx However, instead of x you can enter several letters or numbers, for example: A216-0450-013 X2LP-1018-589 Y585-0000-047 What I need to do is compare to see if t...
asked by 17.04.2017 / 22:28
2
answers

Regular expression to reorder string

I have the result of a query with several joins , and in a row I have the concatenation of 2 groups. The line returns a string as: 1,4|a1,b4 . What I need is to regroup ID and Value as follows: array( 1 => a1 , 4 =>...
asked by 20.11.2015 / 01:49
1
answer

Separate string by number of characters

I'm developing a component to read the file submitted by DataPrev with the list of monthly obituaries. This file is a TXT and every 210 characters is a different person. The documentation can be seen at this link : SISOBI . I'm used...
asked by 13.03.2015 / 16:09
2
answers

How do I add two strings in C #?

I have a method that will get two strings and return the sum of them in string format. I use string since there will be +30 digits. I'm having trouble converting to add up. :     
asked by 11.06.2015 / 22:05
1
answer

Why String objects are immutable?

Up to the most recent stable version, Java 8, objects of type String are immutable. That is, any change in a String causes the creation of a new object String . Is not this harmful from a performance standpoint? What wa...
asked by 10.11.2016 / 18:28
1
answer

Changing the contents of the char variable

I'm having trouble working with files and manipulating char . CODE char *fileTipoDespesaDefault; char *fileTipoPagamentoDefault; FILE *fileTipoDespesa; FILE *fileTipoPagamento; /** * tipos : 1 => Despesa, 2 => Pagamento */ v...
asked by 18.11.2014 / 13:14
1
answer

Problem with types in function parameter

When you run the following code: function foo(string $text) { echo $text; } foo('bar'); I get the following error:    PHP Catchable fatal error: Argument 1 passed to foo () must be an instance of string, given string, called in / hom...
asked by 24.01.2014 / 01:33