Java tutorial
//package com.java2s; public class Main { protected static int parseVersionPart(String paramString) { int i = 0; String str = paramString.toString(); int j = str.length(); int k = 0; while (true) { int m; if (i < j) { m = str.charAt(i); if ((m <= 57) && (m >= 48)) ; } else { return k; } k = k * 10 + (m - 48); i++; } } }