Java Object Type Case caststring1(String tmpq)

Here you can find the source of caststring1(String tmpq)

Description

caststring

License

Open Source License

Declaration

public static String caststring1(String tmpq) 

Method Source Code

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

public class Main {
    public static String caststring1(String tmpq) {
        String tmp1 = "";
        if (tmpq.indexOf("-") <= 0) {
            int tt = tmpq.indexOf(".");
            if (tt > 0)
                tmp1 = tmpq.substring(0, tt);
            else/*from  w  ww  . j a  v  a2s  .c  om*/
                tmp1 = tmpq;
        } else {
            tmp1 = tmpq;
        }
        return tmp1;
    }
}

Related

  1. castOrDefault(Object o, Class type, T def)
  2. castOrNull(Object o, Class clazz)
  3. castOrNull(Object o, Class cls)
  4. castOrThrowError(Class clazz, T1 object, String messageTemplate)
  5. castSafe(Class inClass, Object inValue, T inDefault)
  6. castTo(Object o, Class cls)
  7. castToArray(Object object)
  8. castToClass_strict(Number valueIn, Class toClassIn)
  9. castToObject(Object value)