public static Integer parseFirstInt(String str) {
      char[] divs = {' ', ':'};

      StringBuilder intStr = new StringBuilder();

      if (null != str) {
         str = str.trim();

         boolean match = false;

         for (int i = 0; i < str.length(); i++) {
            match = false;

            char c = str.charAt(i);

            if (c < '0' || c > '9') {
               for (int j = 0; j < divs.length; j++) {
                  if (divs[j] == c) {
                     match = true;

                     break;
                  }
               }

               if (match) {
                  break;
               } else {
                  return null;
               }
            } else {
               intStr.append(c);
            }
         }

         if (intStr.length() > 0) {
            try {
               return Integer.valueOf(intStr.toString());
            } catch (Exception ex) {
               return null;
            }
         }
      }

      return null;
   }