• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

how to read the string as it is in Java

How can I read a string as it is..?

The actual String is something like this " This is my name <check for break> and I want to test for <check for break>".  but when I'm trying to read this string I can see all special characters are using escape code sequences (ex: < is looking like &lt; and > looks like &gt;) and creating little ptoblem while I want read the string.

Is there any method which makes me read the string as it is Java , though it has escape code sequences...?

Thanks


0
Suda_RamanaReddy
Asked:
Suda_RamanaReddy
  • 2
  • 2
  • 2
  • +1
2 Solutions
 
objectsCommented:
you need to decode them yourself once you're read the string, for eaxample using replaceAll()
0
 
ksivananthCommented:
below are the list of encoded chars and its appropriate decoding,

&amp; & 
&apos; '
&quot; " 
&lt; < 
&gt; > 
0
 
ksivananthCommented:
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Suda_RamanaReddyAuthor Commented:
Hi.... Thanks... We changed the way we input the data...
0
 
Suda_RamanaReddyAuthor Commented:
Can you delete this question now... I think it's better we have the option to delete the question...!
0
 
objectsCommented:
that doesn't make the answers invalid :)
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now