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
    public static int valueOf(String s) {
        if (!isNumeric(s)) {
            return 0;
        } else {/*from   w ww .  ja  va 2s  .com*/
            return Integer.valueOf(s);
        }
    }

    public static boolean isNumeric(String s) {
        if (s == null || s.equals("")) {
            return false;
        }
        for (int i = s.length(); --i >= 0;) {
            if (!Character.isDigit(s.charAt(i))) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. valueOf(Object object, String defaultEmptyValue)
  2. valueOf(String boolStr)
  3. valueOf(String decimal)
  4. valueOf(String first, String defaultstr)
  5. valueOf(String format, String value)
  6. valueOf(String s)
  7. valueOf(String s)
  8. valueOf(String s)
  9. valueOf(String s)