Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between @string and @+string?

Sometimes, when I want to refer a value to a string reference I use @string/blabla, but sometimes, it gives me an error that I can run the code unless i change @string to @+string What's the difference between them? Any answer would be so helpful. Thanks in Advance!

like image 551
Alan Deep Avatar asked Sep 01 '12 14:09

Alan Deep


People also ask

What is diff between string and string?

Essentially, there is no difference between string and String (capital S) in C#. String (capital S) is a class in the . NET framework in the System namespace. The fully qualified name is System.

What is difference between string and string []?

String[] and String... are the same thing internally, i. e., an array of Strings. The difference is that when you use a varargs parameter ( String... ) you can call the method like: public void myMethod( String... foo ) { // do something // foo is an array (String[]) internally System.

What is the difference between string and string in Java?

In brief, there are two ways to create a String in Java which are String Literal and String Object. The main difference between String Literal and String Object is that String Literal is a String created using double quotes while String Object is a String created using the new() operator.

What is difference between variable and string?

Variables are symbols that you can use to store data in a program. You can think of them as an empty box that you fill with some data or value. Strings are data, so we can use them to fill up a variable. Declaring strings as variables can make it easier for us to work with strings throughout our Python programs.


1 Answers

The + means that this identifier will be added to the resources. You declare that it exists somewhere and use it at the same time. Not sure if that really applies to strings but I guess it does. It would explain why you get no error.

And I doubt it is good to use a + to make it work. You could end up with a string declaration with no actual string content which will likely result in a crash.

If it is not working without the + try building / refreshing your project. If the string is defined in one of your xml files you should be able to use @string

like image 153
zapl Avatar answered Oct 02 '22 10:10

zapl