Java String Handling

Java String to InputStream example

Java String to InputStream example shows how to convert String to InputStream in Java. Example also shows how to set character encoding while...

Java String array example

Java String array example shows how to define and initialize Java String array. Example also shows how to add elements and access elements from...

Mask part of string example in Java

Mask part of string example shows how to mask part of the String with * asterisk symbol. Example also shows how to hide credit card number or email...

Java String array initialize example

Java String array initialize example shows how to initialize string array in Java. Example also shows how to declare string array and various ways to...

Java split String by new line Example

Java split String by new line example shows how to split string by new line in Java. Example also shows how to split string by new line using regular...

Java String pad with zero example

Java String pad with zero example shows how to left pad or right pad string with zero in Java. Example also shows how to left pad string with zero...

Create random String in Java example

Create random String in Java example shows how to create random string of specified length in Java. Example also shows how to create random...

Java String array remove duplicates example

Java String array remove duplicates example shows how to remove duplicates from String array in Java. Example also shows how to remove duplicates...

Remove HTML tags from String in Java example

Remove HTML tags from String in Java example shows how to remove HTML tags from String in Java using regular expression. Example also shows how to...

Java String Concatenate Example

Java String Concatenate example shows how to concatenate strings in Java. Example also shows difference between concatenation operator (+) vs concat...

Java split string by comma example

Java split string by comma example shows how to split string by comma in Java. Example also shows how to handle CSV record having comma between...

Java String substring example

Java String substring example shows how to get substring from String in Java. Example also shows how to find substring in string and then get...

Java String keep only letters example

Java String keep only letters example shows how to keep only letters in String. Example also shows how to keep only lowercase letters, only uppercase...

Java String keep only numbers example

Java String keep only numbers example shows how to keep only numbers in String. Example also shows how to remove all non numeric characters from...

Join 1000+ fellow learners! Enter your email address below: