Java String Value Of valueOf(String s)

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

Description

value Of

License

Apache License

Declaration

@Deprecated
public static int valueOf(String s) 

Method Source Code

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

public class Main {
    /** @deprecated */
    @Deprecated
    public static int valueOf(String s) {
        return !isNumeric(s) ? 0 : Integer.valueOf(s).intValue();
    }/*from w w w  .ja  va 2s . c  om*/

    public static boolean isNumeric(String s) {
        if (s != null && !s.equals("")) {
            int i = s.length();

            do {
                --i;
                if (i < 0) {
                    return true;
                }
            } while (Character.isDigit(s.charAt(i)));

            return false;
        } else {
            return false;
        }
    }
}

Related

  1. valueOf(String decimal)
  2. valueOf(String first, String defaultstr)
  3. valueOf(String format, String value)
  4. valueOf(String s)
  5. valueOf(String s)
  6. valueOf(String s)
  7. valueOf(String s)
  8. valueOf(String s, Class e)
  9. valueOf(String s, int def)