How to remove all special characters from String in Java

You can use regular expression and replaceAll() method of java.lang.String class to remove all special characters from String. A special character is nothing but characters like ! #, % etc. Precisely, you need to define what is a special character for you. Once you define that you can use a regular expression to replace those character with empty String, which is equivalent to removing all special characters from String. For example, suppose, your String contains some special characters e.g. "Awesome!!!" and you want to remove those !!! to reduce some excitement, you can use replaceAll("!", "") to get rid of all exclamation mark from String. Similarly, if you String contains many special characters, you can remove all of them by just picking alphanumeric characters e.g. replaceAll("[^a-zA-Z0-9_-]", ""), which will replace anything with empty String except a to z, A to Z, 0 to 9,_ and dash. Let's see couple fo examples to remove all special characters from String in Java.

Introduction of How Android Works for Java Programmers

Android development is a current buzz in Java programming world. It's the Android, which keeps Java in the forefront of the last couple of years. Now, How important is to understand or learn Android for Java programmers? Well, it depends on, if you like application development and want to reach a mass, Android offers that opportunity to you. Millions of Android phones are available and they are keep increasing, with pace, much higher than iPhone or iOS. What all these means is, it does make a lot of sense to learn Android programming for Java programmer, and this article is about that, but this is also a one of the good reason to learn Java programming. This tutorial will give you a basic idea of How Android works? not detailed but a good overview.

5 Good Books to Learn Unit testing, JUnit and TDD in Java

Unit testing is very, very important thing to learn adapt. I would say this is the single most practice in my book which differentiates a good programmer with a professional programmer. It's one way you can see how disciplined a programmer is? It's also the best way to write clean code; a code which can stand the test of time, a code which is flexible enough to accommodate future changes and a code which you don't afraid while changing. Despite several efforts of promoting unit testing by programming community and emphasizing unit testing by many notable programmers, it's still one of the lacking practice.