<awangdev>Compare Version Numbers_2.java
private int compareString(String str1, String str2) {

        if (str1.equals(str2)) {
            return 0;
        }
        while (str1 != null && str1.length() > 1 && str1.charAt(0) == '0') {
            str1 = str1.substring(1);
        }
        
        while (str2 != null && str2.length() > 1 && str2.charAt(0) == '0') {
            str2 = str2.substring(1);
        }
        
        if (str1.length() != str2.length()) {
            return str1.length() < str2.length() ? -1 : 1;
        }
        for (int i = 0; i < str1.length(); i++) {
            int digit1 = str1.charAt(i) - '0';
            int digit2 = str2.charAt(i) - '0';
            if (digit1 < digit2) {
                return -1;
            } else if (digit1 > digit2) {
                return 1;
            }
        }
        return 0;
    }
private int sample_funcname ( String var_1 , String var_2 ) {
  if ( var_1 . equals ( var_2 ) ) {
    return 0 ;
  }
  while ( var_1 != null && var_1 . length ( ) > 1 && var_1 . charAt ( 0 ) == '0' ) {
    var_1 = var_1 . substring ( 1 ) ;
  }
  while ( var_2 != null && var_2 . length ( ) > 1 && var_2 . charAt ( 0 ) == '0' ) {
    var_2 = var_2 . substring ( 1 ) ;
  }
  if ( var_1 . length ( ) != var_2 . length ( ) ) {
    return var_1 . length ( ) < var_2 . length ( ) ? - 1 : 1 ;
  }
  for ( int var_11 = 0 ;
  var_11 < var_1 . length ( ) ;
  var_11 ++ ) {
    int var_12 = var_1 . charAt ( var_11 ) - '0' ;
    int var_13 = var_2 . charAt ( var_11 ) - '0' ;
    if ( var_12 < var_13 ) {
      return - 1 ;
    }
    else if ( var_12 > var_13 ) {
      return 1 ;
    }
  }
  return 0 ;
}
