Here you can find the source of splitAuthors(String source)
static public ArrayList<String> splitAuthors(String source)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { static public ArrayList<String> splitAuthors(String source) { ArrayList<String> authors = new ArrayList<String>(); int idx = source.indexOf("_and_"); if (idx > -1) { String[] fields = source.split("_and_"); for (int i = 0; i < fields.length; i++) { String field = cleanAuthor(fields[i]); if (i > 0) { field = "author:" + field; }/*from w w w. ja va 2 s . co m*/ authors.add(field); } } // System.out.println(authors.toString()); return authors; } public static String cleanAuthor(String author) { String cleanAuthor = author; int idx = author.indexOf("_in_"); if (idx > -1) { cleanAuthor = author.substring(0, idx); } idx = cleanAuthor.indexOf("_at_"); if (idx > -1) { cleanAuthor = cleanAuthor.substring(0, idx); } idx = cleanAuthor.indexOf("?_"); if (idx > -1) { cleanAuthor = cleanAuthor.substring(0, idx); } return cleanAuthor; } }