0

I'm using the @ sign in a project and want to set its text value to a string resource. However android studio complains if i do this. <string name="atsign">@</string>. What is the best way to set the @ sign as a string attribute?

3
  • 1
    <string name="atsign">\@</string> Commented Aug 17, 2018 at 19:39
  • 1
    <string name="atsign">\@</string> Commented Aug 17, 2018 at 19:47
  • 1
    <string name="atsign">@</string> works fine although AS is complaining Commented Aug 17, 2018 at 19:48

2 Answers 2

1

Use this below code in your string.xml file

<string name="at_str">\u0040</string>

Output

This is the output from my app

Sign up to request clarification or add additional context in comments.

Comments

1

use this as your string value

\@

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.