@Universal public static char[] sliceOf( char[] array, int startIndex ) { return slc(array, startIndex); }
@Test public void outOfBounds() { char[] fruit = array( 'a', 'b', 'c', 'd', 'e' ); slcEnd( fruit, 100 ); slcEnd( fruit, -100 ); slc( fruit, 100 ); slc( fruit, -100 ); idx( fruit, 100 ); idx( fruit, -100 ); idx( fruit, 100, 'x' ); idx( fruit, -100, 'z' ); assertEquals( 'x', idx( fruit, -1 ) ); assertEquals( 'z', idx( fruit, 0 ) ); }
@Universal public static char[] sliceOf( char[] array, int startIndex, int endIndex ) { return slc(array, startIndex, endIndex); }
@Universal public static char[] sliceOf( char[] array, int startIndex, int endIndex ) { return slc(array, startIndex, endIndex); }
@Universal public static char[] sliceOf( char[] array, int startIndex ) { return slc(array, startIndex); }
@Universal public static char[] sliceOf( char[] array, int startIndex, int endIndex ) { return slc(array, startIndex, endIndex); }
@Universal public static char[] sliceOf( char[] array, int startIndex ) { return slc(array, startIndex); }
/** * Get slice of string * @param str string * @param start start index * @param end end index * @return new string */ @Universal public static String slc( String str, int start, int end ) { return FastStringUtils.noCopyStringFromChars(Chr.slc(FastStringUtils.toCharArray(str), start, end)); }
/** * Gets slice of a string. * @param str string * @param start start index of slice * @return new string */ @Universal public static String slc( String str, int start ) { return FastStringUtils.noCopyStringFromChars( Chr.slc( FastStringUtils.toCharArray(str), start ) ); }
/** * Gets slice of a string. * @param str string * @param start start index of slice * @return new string */ @Universal public static String slc( String str, int start ) { return FastStringUtils.noCopyStringFromChars( Chr.slc( FastStringUtils.toCharArray(str), start ) ); }
/** * Get slice of string * @param str string * @param start start index * @param end end index * @return new string */ @Universal public static String slc( String str, int start, int end ) { return FastStringUtils.noCopyStringFromChars(Chr.slc(FastStringUtils.toCharArray(str), start, end)); }
/** * Gets slice of a string. * @param str string * @param start start index of slice * @return new string */ @Universal public static String slc( String str, int start ) { return FastStringUtils.noCopyStringFromChars( Chr.slc( FastStringUtils.toCharArray(str), start ) ); }
/** * Get slice of string * @param str string * @param start start index * @param end end index * @return new string */ @Universal public static String slc( String str, int start, int end ) { return FastStringUtils.noCopyStringFromChars(Chr.slc(FastStringUtils.toCharArray(str), start, end)); }