package com.abin.inter.test;
public class SplitString1 {
public static void main(String[] args) {
StringBuffer stb = new StringBuffer();
String unitId1 = "aaaaa";
String callerNumber1 = "bbbbb";
String calleeNumber1 = "ccccc";
stb.append(unitId1).append("|").append(callerNumber1).append("|")
.append(calleeNumber1);
System.out.println("stb=" + stb.toString());
String unitId = stb.toString()
.substring(0, stb.toString().indexOf("|"));
System.out.println("unitId=" + unitId);
String temp1 = stb.toString().substring(unitId.length() + 1,
stb.toString().length() - unitId.length());
System.out.println("temp1=" + temp1);
String callerNumber = temp1.substring(0, temp1.indexOf("|"));
System.out.println("callerNumber=" + callerNumber);
System.out.println("unitId.length()=" + unitId.length());
System.out.println("callerNumber.length()=" + callerNumber.length());
System.out.println("stb=" + stb.toString().length());
String temp2 = stb.toString().substring(
unitId.length() + callerNumber.length() + 2,
stb.toString().length());
System.out.println("temp2=" + temp2);
String calleeNumber = temp2.substring(0, temp2.length());
System.out.println("calleeNumber=" + calleeNumber);
}
}