Java Second Get getSecondName(String names)

Here you can find the source of getSecondName(String names)

Description

get Second Name

License

LGPL

Declaration

public static String getSecondName(String names) throws Exception 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String getSecondName(String names) throws Exception {
        if (names == null) {
            throw new Exception("Names cannot be null");
        }/*from w w  w.  j a v  a2s .  c o m*/
        // remove leading and trailing whitespace
        String temp = names.trim();

        if (temp.contains(" ")) {
            return temp.substring(temp.indexOf(" ")).trim();
        }
        return temp;
    }
}

Related

  1. getSecondFromHMS(String hms)
  2. getSecondFromTime(int hour, int minute, int second)
  3. getSecondInt(long c)
  4. getSecondInt(long time)
  5. getSecondMaxInArray(float[] arr)
  6. getSecondRDNValue(String dn)
  7. getSecondRulePart()
  8. getSeconds()
  9. getSeconds(double coordinate)