Here you can find the source of getTitleFromDocument(Document doc)
public static String getTitleFromDocument(Document doc)
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Document; public class Main { public static String getTitleFromDocument(Document doc) { String title = (doc != null) ? doc.title() : "none"; String[] titleText = title.split("-"); return titleText[0].trim(); }//from w ww .j a v a 2s. c om }