Java Integer Create toInt(String param)

Here you can find the source of toInt(String param)

Description

Convert String to Integer

License

LGPL

Parameter

Parameter Description
param a parameter

Declaration

public static int toInt(String param) 

Method Source Code

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

public class Main {
    /**/*w w  w .j ava 2 s .  c o  m*/
     * 
     * <p>
     * Convert String to Integer
     * </p>
     * 
     * @param param
     * @return
     */
    public static int toInt(String param) {

        try {
            return Integer.valueOf(param.trim());
        } catch (Exception e) {
            return 0;
        }
    }
}

Related

  1. toInt(String input, int offset, int length)
  2. toInt(String intValue, int defaultValue)
  3. toInt(String number)
  4. toInt(String numStr, int defaultValue)
  5. toInt(String param)
  6. toInt(String pString)
  7. toInt(String s)
  8. toInt(String s)
  9. toInt(String s)