@Test public void trimTest() { char[] letters = array( ' ', '\n', 'a', 'b', 'c', ' ', '\n', '\t' ); char[] results = trim( letters, 0, letters.length ); assertArrayEquals( array( 'a', 'b', 'c' ), results ); }
public static char[] trim( char[] buffer, int start, int to ) { while ( ( start < to ) && ( buffer[ start ] <= ' ' ) ) { start++; } while ( ( start < to ) && ( buffer[ to - 1 ] <= ' ' ) ) { to--; } return ( ( start > 0 ) || ( to < buffer.length ) ) ? java.util.Arrays.copyOfRange( buffer, start, to ) : buffer; }
Chr { public static char[] trim( char[] buffer, int start, int to ) { while ( ( start < to ) && ( buffer[ start ] <= ' ' ) ) { start++; } while ( ( start < to ) && ( buffer[ to - 1 ] <= ' ' ) ) { to--; } return ( ( start > 0 ) || ( to < buffer.length ) ) ? java.util.Arrays.copyOfRange( buffer, start, to ) : buffer; } }
Chr { public static char[] trim( char[] buffer, int start, int to ) { while ( ( start < to ) && ( buffer[ start ] <= ' ' ) ) { start++; } while ( ( start < to ) && ( buffer[ to - 1 ] <= ' ' ) ) { to--; } return ( ( start > 0 ) || ( to < buffer.length ) ) ? java.util.Arrays.copyOfRange( buffer, start, to ) : buffer; }  }
Chr { public static char[] trim( char[] buffer, int start, int to ) { while ( ( start < to ) && ( buffer[ start ] <= ' ' ) ) { start++; } while ( ( start < to ) && ( buffer[ to - 1 ] <= ' ' ) ) { to--; } return ( ( start > 0 ) || ( to < buffer.length ) ) ? java.util.Arrays.copyOfRange( buffer, start, to ) : buffer; }  static char[] arrayOfChar( final int size ); @Universal static char[] array( final char... array ); @Universal static char[] chars( final String array ); @Universal static int lengthOf( char[] array ); @Universal static int len( char[] array ); @Universal static char atIndex( final char[] array, final int index ); @Universal static char idx( final char[] array, final int index ); @Universal static void atIndex( final char[] array, int index, char value ); @Universal static void idx( final char[] array, int index, char value ); @Universal static void atIndex( final char[] array, int index, char[] input ); @Universal static void idx( final char[] array, int index, char[] input ); @Universal static char[] sliceOf( char[] array, int startIndex, int endIndex ); @Universal static char[] slc( char[] array, int startIndex, int endIndex ); @Universal static char[] sliceOf( char[] array, int startIndex ); @Universal static char[] slc( char[] array, int startIndex ); @Universal static char[] endSliceOf( char[] array, int endIndex ); @Universal static char[] slcEnd( char[] array, int endIndex ); @Universal static boolean in( char value, char[] array ); @Universal static boolean in( char[] values, char[] array ); @Universal static boolean in( int value, char[] array ); @Universal static boolean in( char value, int offset, char[] array ); @Universal static boolean in( char value, int offset, int end, char[] array ); static char[] grow( char[] array, final int size ); static char[] grow( char[] array ); static char[] shrink( char[] array, int size ); static char[] compact( char[] array ); static char[] remove( char c, char[] array ); static char[] remove( char c, char[] array, int start, int to ); static char[][] split( char[] chars ); static char[][] splitLine( char[] chars ); @Universal static char[] copy( char[] array ); @Universal static char[] copy( char[] array, int offset, int length ); @Universal static char[] add( char[] array, char v ); @Universal static char[] add( char[] array, String str ); @Universal static char[] add( char[] array, StringBuilder stringBuilder ); @Universal static char[] add( char[] array, char[] array2 ); @Universal static char[] insert( final char[] array, final int idx, final char v ); @Universal static char[] insert( final char[] array, final int fromIndex, String values ); @Universal static char[] insert( final char[] array, final int fromIndex, StringBuilder values ); @Universal static char[] insert( final char[] array, final int fromIndex, final char[] values ); static char[] rpad( final char[] in, final int size, char pad ); static char[] lpad( final char[] in, final int size, char pad ); static char[] underBarCase( char[] in ); static char[] camelCase( char[] in, boolean upper ); static char[][] split( final char[] inputArray,
                                  final char split ); static boolean contains( char[] chars, char c ); static boolean contains( char[] chars, char c, int start, final int length ); static void _idx( char[] buffer, int location, byte[] chars ); static void _idx( final char[] array, int startIndex, char[] input ); static void _idx( final char[] array, int startIndex, char[] input, final int inputLength ); static void _idx( char[] buffer, int location, byte[] chars, int start, int end ); static char[] trim( char[] buffer, int start, int to ); static boolean equals( char[] chars1, char[] chars2 ); static boolean equalsNoNullCheck( char[] chars1, char[] chars2 ); static char[] add( char[]... strings ); static char[][] splitLines(char[] chars); static char[][] splitComma(char[] chars); static void equalsOrDie(char[] ac, char[] bc); static char [] multiply(char c, int len); static boolean insideOf(char[] startsWith, char[] chars, char[] endsWith); static boolean isEmpty(char[] messageBodyChars); }
Chr { public static char[] trim( char[] buffer, int start, int to ) { while ( ( start < to ) && ( buffer[ start ] <= ' ' ) ) { start++; } while ( ( start < to ) && ( buffer[ to - 1 ] <= ' ' ) ) { to--; } return ( ( start > 0 ) || ( to < buffer.length ) ) ? java.util.Arrays.copyOfRange( buffer, start, to ) : buffer; }  static char[] arrayOfChar( final int size ); @Universal static char[] array( final char... array ); @Universal static char[] chars( final String array ); @Universal static int lengthOf( char[] array ); @Universal static int len( char[] array ); @Universal static char atIndex( final char[] array, final int index ); @Universal static char idx( final char[] array, final int index ); @Universal static void atIndex( final char[] array, int index, char value ); @Universal static void idx( final char[] array, int index, char value ); @Universal static void atIndex( final char[] array, int index, char[] input ); @Universal static void idx( final char[] array, int index, char[] input ); @Universal static char[] sliceOf( char[] array, int startIndex, int endIndex ); @Universal static char[] slc( char[] array, int startIndex, int endIndex ); @Universal static char[] sliceOf( char[] array, int startIndex ); @Universal static char[] slc( char[] array, int startIndex ); @Universal static char[] endSliceOf( char[] array, int endIndex ); @Universal static char[] slcEnd( char[] array, int endIndex ); @Universal static boolean in( char value, char[] array ); @Universal static boolean in( char[] values, char[] array ); @Universal static boolean in( int value, char[] array ); @Universal static boolean in( char value, int offset, char[] array ); @Universal static boolean in( char value, int offset, int end, char[] array ); static char[] grow( char[] array, final int size ); static char[] grow( char[] array ); static char[] shrink( char[] array, int size ); static char[] compact( char[] array ); static char[] remove( char c, char[] array ); static char[] remove( char c, char[] array, int start, int to ); static char[][] split( char[] chars ); static char[][] splitLine( char[] chars ); @Universal static char[] copy( char[] array ); @Universal static char[] copy( char[] array, int offset, int length ); @Universal static char[] add( char[] array, char v ); @Universal static char[] add( char[] array, String str ); @Universal static char[] add( char[] array, StringBuilder stringBuilder ); @Universal static char[] add( char[] array, char[] array2 ); @Universal static char[] insert( final char[] array, final int idx, final char v ); @Universal static char[] insert( final char[] array, final int fromIndex, String values ); @Universal static char[] insert( final char[] array, final int fromIndex, StringBuilder values ); @Universal static char[] insert( final char[] array, final int fromIndex, final char[] values ); static char[] rpad( final char[] in, final int size, char pad ); static char[] lpad( final char[] in, final int size, char pad ); static char[] underBarCase( char[] in ); static char[] camelCase( char[] in, boolean upper ); static char[][] split( final char[] inputArray,
                                  final char split ); static boolean contains( char[] chars, char c ); static boolean contains( char[] chars, char c, int start, final int length ); static void _idx( char[] buffer, int location, byte[] chars ); static void _idx( final char[] array, int startIndex, char[] input ); static void _idx( final char[] array, int startIndex, char[] input, final int inputLength ); static void _idx( char[] buffer, int location, byte[] chars, int start, int end ); static char[] trim( char[] buffer, int start, int to ); static boolean equals( char[] chars1, char[] chars2 ); static boolean equalsNoNullCheck( char[] chars1, char[] chars2 ); static char[] add( char[]... strings ); static char[][] splitLines(char[] chars); static char[][] splitComma(char[] chars); static void equalsOrDie(char[] ac, char[] bc); static char [] multiply(char c, int len); static boolean insideOf(char[] startsWith, char[] chars, char[] endsWith); static boolean isEmpty(char[] messageBodyChars); static final char[] DEFAULT_SPLIT; static final char[] NEWLINE_CHARS; }