1

How to read Special Character # from Properties file in Java

password=Admin123#

when i read read password from properties file i am getting

password=Admin123

Rehman
  • 11
  • 1
  • 2
  • This is the comment character so everything following the `#` on the line will not appear if you use the Properties instance to read the file. See how to escape those – AxelH Apr 06 '17 at 09:44
  • Thanks It Worked for me – Rehman Apr 11 '17 at 13:44

1 Answers1

2

You need to escape special characters: How to escape the equals sign in properties files see answer 4 exactly for your case: https://stackoverflow.com/a/33808156/3453727

Community
  • 1
  • 1
Alex Chernyshev
  • 1,719
  • 9
  • 11