/** * Checks whether or not a String consists only of spaces. * * @param str * The string to check * @return true if the string has nothing but spaces. */ public static final boolean onlySpaces( String str ) { for ( int i = 0; i < str.length(); i++ ) { if ( !isSpace( str.charAt( i ) ) ) { return false; } } return true; }
/** * @deprecated Use {@link Const#isSpace(char)} instead * @throws KettleValueException */ @Deprecated @Test public void testIsSpace() throws KettleValueException { assertTrue( ValueDataUtil.isSpace( ' ' ) ); assertTrue( ValueDataUtil.isSpace( '\t' ) ); assertTrue( ValueDataUtil.isSpace( '\r' ) ); assertTrue( ValueDataUtil.isSpace( '\n' ) ); assertFalse( ValueDataUtil.isSpace( 'S' ) ); assertFalse( ValueDataUtil.isSpace( 'b' ) ); }