If you have used stored JSON, XML data, database queries, or file paths as string literals, you know it is difficult to write and read such code. This section will highlight examples of how a traditional raw string will improve the readability of your code when working with these types of data.
Common examples
JSON data
Suppose that you have the following JSON data to be stored as a Java string:
{"plastic": { "id": "98751", "singleuse": { "item": [ {"value": "Water Bottle", "replaceWith": "Steel Bottle()"}, {"value": "Straw", "replaceWith": "Ban Straws"}, {"value...