やりたいことの例:最初の引数と 2 番目の引数として
渡すと、メソッドは戻ります"abc|xyz"
"|"
List("abc","xyz")
public List<String> splitIt(String string, String delimiter){
//create and init arraylist.
List<String> list = new ArrayList<String>();
//create and init newString.
String newString="";
//add string to arraylist 'list'.
list.add(string);
//loops through string.
for(int i=0;i<string.length();i++){
//stores each character from string in newString.
newString += string.charAt(i);
}
newString.replace(delimiter, "");
//remove string from arraylist 'list'.
list.remove(string);
//add newString to arraylist 'list'.
list.add(newString);
return list;
}