(SOLVED) convert String to Date in Java ?

In this tutorial, we will show you how to convert a String to java.util.Date. Many Java beginners Always find this problem of Date conversion. so we decided to post this solution !! let understand how to convert String Date in JAVA. java.text.SimpleDateFormat provide many date and time patterns : Letter Description Examples y Year 2013 […]

En Lire Plus

(SOLVED) regex match for alphanumeric string

If you need to check whether a password is alphanumeric or not using regex try this Java Solution : what is the difference between login.getPassword().matches(“[0-9a-zA-Z]*”); and login.getPassword().matches(“[0-9a-zA-Z]”); ? Answer : The .matches(“[0-9a-zA-Z]”) will only return true if the whole string contains just 1 digit or letter. The * in [0-9a-zA-Z]* will allow an empty string, […]

En Lire Plus

How to pad a String in Java ?

pad a String in Java : This article shows you how to use the JDK1.5 String.format() and Apache Common Lang to left or right pad a String in Java. 1. String.format : By default, the String.format() fills extra with spaces \u0020. Normally, we use replace() to pad with other chars, but it will replace the spaces in between the given string. 2. Apache Common […]

En Lire Plus