title: How to find the String with more numbers?
body: <p>Trying to find the String with more numbers. Output should me the text which fulfills the condition, how many charachters are in String.</p>
  
  <pre><code>public static String countNr(String a) {
          int count = 0;
          int maxNr = 0;
  
          String text= null;
  
          int i;
          for( i =0 ; i &lt; a.length(); i++){
              char c = a.charAt(i) ;
              if(text==null || Character.isDigit(c)){
                  count++;
                  if( count &lt; maxNr){
                    maxNr  = count ;
                    text+= a ; // in output alway null
                  }
              }
          }
  
          return text + ":" + a.length() + "-" +  i;
      }
  }
  </code></pre>