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!
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With