Home > Blockchain >  How can I escape these characters?
How can I escape these characters?

Time:05-16

I have a string, but I get these:

Hsbc_$/'\|<?¡!¿&%$#.,-}{][

And how can I escape them so the result I get is the following?

Hsbc_$/'\\|<?\u00A1!\u00BF&%$#.,-}{][

CodePudding user response:

To show the escape sequence rather than the resulting character, you can escape the escape. For example:

Hsbc_$/'\\|<?\\u00A1!\\u00BF&%$#.,-}{][

CodePudding user response:

String a="Hsbc_$/'\\\\|<?\\u00A1!\\u00BF&%$#.,-}{][";
System.out.println(a);

Output:

Hsbc_$/'\\|<?\u00A1!\u00BF&%$#.,-}{][
  • Related