Пример #1
0
 public void setImage() {
   int originlength = description.length();
   String url =
       Utils.RegexFind(
           "<img class=\"content-image\\\" src=\"[^>]*jpg\"|<img src=\"[^>]*jpg\"",
           description,
           5,
           0);
   int currentlength = url.length() + 5;
   if (originlength != currentlength) {
     url = Utils.RegexFind("\"[^\"]*jpg\"", url);
   }
   image = originlength == currentlength ? CONSTANT.placeHolderUri : url;
 }
Пример #2
0
 private String formatTime(String pubTime) {
   String date =
       Utils.RegexFind(" \\d{4} ", pubTime)
           + "年"
           + formatMonth(Utils.RegexFind(" \\w{3} ", pubTime))
           + "月"
           + Utils.RegexFind(" \\d{1,2} ", pubTime)
           + "日"
           + Utils.RegexFind(" \\d{2}:", pubTime)
           + "点"
           + Utils.RegexFind(":\\d{2}:", pubTime)
           + "分"
           + Utils.RegexFind(":\\d{2} ", pubTime)
           + "秒";
   return date;
 }