public static String ensurePixels ( String value ) { int index = 0 ; for ( int nn = value . length ( ) ; index < nn ; index ++ ) { char c = value . charAt ( index ) ; if ( c < ' ' || c > ' ' ) { break ; } } return value . substring ( 0 , index ) ; }
Chops off any non - numeric suffix .