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: String
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
Merging two character arrays
In this post under Java. I will show with example how to merge two character arrays into one. Below is the complete code for your reference. Main Class 1 package core.string; 2 3 public class Example1 { 4 public static void main(String[] args) { 5 char[] inputArray1 = {‘a’, ‘b’, ‘c’}; 6 char[] inputArray2 =…… Continue reading Merging two character arrays