我使用jsoup从网站中提取链接。我想提取一个仅包含一些关键字的指定链接。我想检索包含关键字“下载”的链接。怎么做。我有以下代码
Document doc = Jsoup.parse( new URL("http://www.examplesite.com));
Element link = doc.select("a").first();
Run Code Online (Sandbox Code Playgroud) 我有一个包含多行的字符串,我想读取一个特定的行并将其保存到另一个字符串.那是我的代码
String text ="example text line\n
example text line\n
example text line\n
example text line\n
example text line\n
example text line\n
example text line\n";
String textline1="";
String textline2="";
Run Code Online (Sandbox Code Playgroud)
在上面的字符串textline1和textline2我想保存特定的行.
我想在字符串中找到一个文本并替换它,但它不能处理我的代码.我必须提到我通常会获得webview的标题,但是当我输出text2i 时,我得到整个标题(不替换文本).除了text2位于空隙内的所有字符串.
String text1 = web1.getTitle();
String text2 = text1.toString().replace("-Click 2U - Files", "");
Run Code Online (Sandbox Code Playgroud)
先感谢您....