Java tutorial
//package com.java2s; public class Main { public static String getDueDateString(String itemText) { String dateString = null; int startIndex = itemText.indexOf("["); int endIndex = itemText.indexOf("]"); if (startIndex != -1 && endIndex != -1) dateString = itemText.substring(startIndex + 1, endIndex); return dateString; } }