Here you can find the source of getTextBeforeFirstAndSecondColumns(String s)
public static String getTextBeforeFirstAndSecondColumns(String s)
//package com.java2s; /*/* w ww.ja v a 2 s .c o m*/ * StringUtil.java * * Copyright (c) 2005-2009 Andrew Krizhanovsky <andrew.krizhanovsky at gmail.com> * Distributed under GNU Public License. */ public class Main { private final static String NULL_STRING = ""; public static String getTextBeforeFirstAndSecondColumns(String s) { if (null == s) return NULL_STRING; int i1 = s.indexOf(58); // ":" = 58 if (-1 == i1) return s; int i2 = s.indexOf(58, i1 + 1); if (-1 == i2) return s.substring(i1 + 1); return s.substring(i1 + 1, i2); } }