Archive For April 27, 2017

Remove vietnammese mark in string

By |

Example: public class CharacterUtils {     private static char[] SOURCE_CHARACTERS = { ‘À’, ‘Á’, ‘Â’, ‘Ã’, ‘È’, ‘É’,             ‘Ê’, ‘Ì’, ‘Í’, ‘Ò’, ‘Ó’, ‘Ô’, ‘Õ’, ‘Ù’, ‘Ú’, ‘Ý’, ‘à’, ‘á’, ‘â’,             ‘ã’, ‘è’, ‘é’, ‘ê’, ‘ì’, ‘í’, ‘ò’, ‘ó’, ‘ô’, ‘õ’, ‘ù’, ‘ú’, ‘ý’,             ‘Ă’, ‘ă’,…

Read more »

Performance test for javascript code

By |

Code: console.time(‘timerName’); //your javascript code console.timeEnd(‘timerName’); Example: console.time(‘timerName’); console.log(“heelo”); console.timeEnd(‘timerName’);

Read more »

Convert string to date in java

By |

try { Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.set(2017, 04, 08); int startYear = cal.get(Calendar.YEAR); int startMonth = cal.get(Calendar.MONTH); int startDay = cal.get(Calendar.DAY_OF_MONTH); System.out.println(“date year ” + startYear); System.out.println(“date month ” + startMonth); System.out.println(“date day ” + startDay); cal.setTime(date); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); System.out.println(“date…

Read more »

Date format Java

By |

Letter Date or Time Component Presentation Examples G Era designator Text AD y Year Year 1996; 96 Y Week year Year 2009; 09 M Month in year Month July; Jul; 07 w Week in year Number 27 W Week in month Number 2 D Day in year Number 189 d Day in month Number 10…

Read more »