@Test public void testSplitString() { int expectSliceNumber = 3; String left = "00468374-8cdb-11e4-a66a-008cfac1c3b8"; String right = "fcbc8a79-8427-11e4-a66a-008cfac1c3b8"; String[] result = RangeSplitUtil.doAsciiStringSplit(left, right, expectSliceNumber); Assert.assertTrue(result.length - 1 == expectSliceNumber); System.out.println(Arrays.toString(result)); }
public static String[] doAsciiStringSplit(String left, String right, int expectSliceNumber) { int radix = 128; BigInteger[] tempResult = doBigIntegerSplit(stringToBigInteger(left, radix), stringToBigInteger(right, radix), expectSliceNumber); String[] result = new String[tempResult.length]; result[0] = left; result[tempResult.length - 1] = right; for (int i = 1, len = tempResult.length - 1; i < len; i++) { result[i] = bigIntegerToString(tempResult[i], radix); } return result; }
RangeSplitUtil { public static String[] doAsciiStringSplit(String left, String right, int expectSliceNumber) { int radix = 128; BigInteger[] tempResult = doBigIntegerSplit(stringToBigInteger(left, radix), stringToBigInteger(right, radix), expectSliceNumber); String[] result = new String[tempResult.length]; result[0] = left; result[tempResult.length - 1] = right; for (int i = 1, len = tempResult.length - 1; i < len; i++) { result[i] = bigIntegerToString(tempResult[i], radix); } return result; } }
RangeSplitUtil { public static String[] doAsciiStringSplit(String left, String right, int expectSliceNumber) { int radix = 128; BigInteger[] tempResult = doBigIntegerSplit(stringToBigInteger(left, radix), stringToBigInteger(right, radix), expectSliceNumber); String[] result = new String[tempResult.length]; result[0] = left; result[tempResult.length - 1] = right; for (int i = 1, len = tempResult.length - 1; i < len; i++) { result[i] = bigIntegerToString(tempResult[i], radix); } return result; }  }
RangeSplitUtil { public static String[] doAsciiStringSplit(String left, String right, int expectSliceNumber) { int radix = 128; BigInteger[] tempResult = doBigIntegerSplit(stringToBigInteger(left, radix), stringToBigInteger(right, radix), expectSliceNumber); String[] result = new String[tempResult.length]; result[0] = left; result[tempResult.length - 1] = right; for (int i = 1, len = tempResult.length - 1; i < len; i++) { result[i] = bigIntegerToString(tempResult[i], radix); } return result; }  static String[] doAsciiStringSplit(String left, String right, int expectSliceNumber); static long[] doLongSplit(long left, long right, int expectSliceNumber); static BigInteger[] doBigIntegerSplit(BigInteger left, BigInteger right, int expectSliceNumber); static BigInteger stringToBigInteger(String aString, int radix); static Pair<Character, Character> getMinAndMaxCharacter(String aString); }
RangeSplitUtil { public static String[] doAsciiStringSplit(String left, String right, int expectSliceNumber) { int radix = 128; BigInteger[] tempResult = doBigIntegerSplit(stringToBigInteger(left, radix), stringToBigInteger(right, radix), expectSliceNumber); String[] result = new String[tempResult.length]; result[0] = left; result[tempResult.length - 1] = right; for (int i = 1, len = tempResult.length - 1; i < len; i++) { result[i] = bigIntegerToString(tempResult[i], radix); } return result; }  static String[] doAsciiStringSplit(String left, String right, int expectSliceNumber); static long[] doLongSplit(long left, long right, int expectSliceNumber); static BigInteger[] doBigIntegerSplit(BigInteger left, BigInteger right, int expectSliceNumber); static BigInteger stringToBigInteger(String aString, int radix); static Pair<Character, Character> getMinAndMaxCharacter(String aString);  }