Java tutorial
//package com.java2s; public class Main { public static String[] splitLabelAndValue(String str) { return splitLabelAndValue(str, ":"); } public static String[] splitLabelAndValue(String str, String expr) { String[] strs = null; if (str != null && str.indexOf(expr) > 0) { strs = str.split(expr); } return strs; } }