VistaStringUtils { public static String piece(String s) { return piece(s, U); }  static String piece(String s); static String piece(String s, int piece1); static String piece(String s, int piece1, int piece2); static String piece(String s, String delimiter); static String piece(String s, String delimiter, int piece1); static String piece(String s, String delimiter, int piece1, int piece2); static String translate(String s, String identifier, String associator); static long crc16(String s); static String crc16Hex(String s); static Object splitLargeStringIfNecessary(String s); static Object splitLargeStringIfNecessary(String s, int length); static String nameCase(String s); static final String U; }
@Test public void testPiece1() { TestCase.assertEquals("Piece1", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^")); }
@Test public void testPiece2() { assertEquals("Piece2", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 2)); }
@Test public void testPiece3() { assertEquals("Piece3", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 3)); }
@Test public void testPiece4() { assertEquals("", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 4)); }
@Test public void testPiece5() { assertEquals("Piece1^Piece2", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 1, 2)); }
@Test public void testPiece6() { assertEquals("Piece2^Piece3", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 2, 3)); }
@Test public void testPiece7() { assertEquals("Piece2^Piece3", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 2, 4)); }
@Test public void testPiece8() { assertEquals("Piece3", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 3, 5)); }
@Test public void testPiece9() { assertEquals("", VistaStringUtils.piece("Piece1^Piece2^Piece3", "^", 4, 6)); }