Java examples for java.lang:int Parse
get Int from String
//package com.java2s; public class Main { public static void main(String[] argv) { String content = "java2s.com"; System.out.println(getInt(content)); }// ww w .j av a 2s.c o m public static int getInt(String content) { int intContent; try { intContent = Integer.parseInt(content); } catch (Exception e) { intContent = 0; } return intContent; } }