Java Second Get getSecondField(String rowStr, char delimiter)

Here you can find the source of getSecondField(String rowStr, char delimiter)

Description

get Second Field

License

Open Source License

Declaration

public static String getSecondField(String rowStr, char delimiter) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String getSecondField(String rowStr, char delimiter) {
        int firstDelim = rowStr.indexOf(delimiter);
        if (firstDelim < 0)
            return null;

        int secondDelim = rowStr.indexOf(delimiter, firstDelim + 1);
        if (secondDelim < 0)
            return null;

        String field1 = rowStr.substring(firstDelim + 1, secondDelim).trim();
        return field1;
    }/*from   w  ww  .ja va 2 s . c  om*/
}

Related

  1. getSecondByDay(int day)
  2. getSecondByHour(int hour)
  3. getSecondByteFromInt(int num)
  4. getSecondColumnAsArray(String[][] stringMatrix)
  5. getSecondExampleTime()
  6. getSecondFromHMS(String hms)
  7. getSecondFromTime(int hour, int minute, int second)
  8. getSecondInt(long c)
  9. getSecondInt(long time)