In this post under Java Core, I will show you with example how indentation is calculated in Text Block. Below is the main class with three variety of text block. Example3 package core.string; public class Example3 { public static void main(String[] args) { String textBlock1 = """ <html> <head> <title>TextBlock1<title> </head> <body>Body of TextBlock1</body> </html>…… Continue reading Text Block With Indentation
Tag: Text Block
Text Block simple example
In this post under Java Core, I will introduce you to newly added “Text Block” feature. This feature was added as part of Java 15. Pre Java 15, if we have to declare a multiline string we used to declare it as shown below String result = "Since Java 15, text blocks are \n" +…… Continue reading Text Block simple example