public static String stripNonNumber ( String string ) { if ( string == null ) return null ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { char ch = string . charAt ( i ) ; if ( ! ( Character . isDigit ( ch ) ) ) if ( ch != gchDot ) if ( ch != gchMinus ) { string = string . substring ( 0 , i ) + string . substring ( i + 1 ) ; i -- ; } } return string ; }
Utility to strip all the non - numeric characters from this string .