How to add @ character to string in android?

I am working on android. In my project, I add '|' the character and the @ symbol, but it does not add the @ symbol. not where I made a mistake. Please help me with this.

String str="";
str = str + "|" + id + "@" + id2 + "@" + id3;

When I print the string "str", it only displays the id value, but does not print id1 and id2. Conclusion: | thirteen

+5
source share
3 answers

Use this:

<string name="strings">\@Strings</string>
0
source

I checked it like

String id = "A";
String id2 = "B";
String id3 = "C";

        String str="";
        str = str + "|" + id + "@" + id2 + "@" + id3;

and Output Like

|A@B@C
0
source

I tried this

TextView tvAt = (TextView)findViewById(R.id.tvAtExample);
String id1 = "A";
String id2 = "B"; 
String id3 = "C";
tvAt.setText(id1 + "|"+ id2 + "@" + id3);

code>

His work, he draws a conclusion

A | B @ c

0
source

All Articles