Say String wsdlString
would be what you get as input and the result of your method should be a ArrayList<String>
:
public ArrayList<String> seperateIntoList(String wsdlString){
String[] resultArray = wsdlString.split(";");
ArrayList<String> resultList = new ArrayList<String>(resultArray.size());
for(String listItem: resultArray) {
resultList.add(listItem);
}
return resultList;
}
I wasn't quite sure, but if you only want a String with linebreaks instead of a List
you can just use wsdlString.replace(";","\n");