Java Second Get getTextBeforeFirstAndSecondColumns(String s)

Here you can find the source of getTextBeforeFirstAndSecondColumns(String s)

Description

get Text Before First And Second Columns

License

Open Source License

Declaration

public static String getTextBeforeFirstAndSecondColumns(String s) 

Method Source Code

//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);
    }
}

Related

  1. getSecondTime()
  2. getSecondTime(String time)
  3. getSecondToLastIndexOf(String string, char character)
  4. getSecondVersion(String buildId)
  5. getSYNTimeSeconds()
  6. getTimeAsSeconds(String value)
  7. GetTimeFromSeconds(double time)
  8. getTimeFromSeconds(int seconds)
  9. getTimeInSecondResolution(long timeMillis)