当前位置: 首页 > news >正文

网站聚合怎么做超级软文

网站聚合怎么做,超级软文,计算机程序网站开发是什么,七牛cdn wordpress目录 常用方法逆序升序List<自定义类>排序List删除元素List转String数组List的add函数查找一个,分隔的字符串中是否有某值根据.分割字符串根据空格分隔字符串 常用方法 逆序 Collections.reverse(List) 升序 Collections.sort(List) List<自定义类>排序 首先…

目录

  • 常用方法
    • 逆序
    • 升序
    • List<自定义类>排序
    • List删除元素
    • List转String数组
    • List的add函数
    • 查找一个,分隔的字符串中是否有某值
    • 根据`.`分割字符串
    • 根据空格分隔字符串

常用方法

逆序

Collections.reverse(List)

升序

Collections.sort(List)

List<自定义类>排序

首先让自定义类实现Comparable<自定义类名称>,举例:

public class Order implements Comparable<Order> {@Overridepublic int compareTo(Order o) {return this.createTime.compareTo(o.getCreateTime());} // 注意java.util.Date不能用<=>比较,但是该类实现了Comparable接口
}

在需要排序处:

List<Order> orders = new ArrayList<>();
// 填充数据
// 升序:
Collections.sort(orders);
//降序:
Collections.sort(orders, Collections.reverseOrder());

List删除元素

单一删除的话,可以用List自带的remove,然后break。不然如果是删index0,有可能死循环没结果。
推荐使用Iterator删除,因为不需要跳出循环

import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;class Rextester {public static void main(String[] args) {List<String> list1 = new ArrayList<>();list1.add("aa");list1.add("bb");list1.add("cc");System.out.println(list1.size());Iterator<String> it = list1.iterator();while(it.hasNext()) {String x = it.next();if(x.equals("aa") || x.equals("cc")) {it.remove();}}/*for(String x: list1) {if(x.equals("aa")) {list1.remove(x);break;}}*/System.out.println(list1.size());for (String str : list1) {System.out.println("*"+str+"*");}}
}

List转String数组

List<String> result = new ArrayList<String>();
return result.toArray(new String[result.size()]);

List的add函数

如果连续几次添加同一个对象,期间如果对象的值发生改变,那存的就是最后的值,几个相同。

查找一个,分隔的字符串中是否有某值

split函数返回的是字符串数组,contains函数返回true或者false

import java.util.Arrays;
String[] temp = synonym.split(",");
Arrays.asList(temp).contains(name)

根据.分割字符串

分割符是 . 的时候一定要小心,需要转义String[] temp = fileName.split("\\.");当分隔的结果数组,后面有空格的时候,会被split函数删掉,比如“,123,,”用 , 作分隔符split的时候,结果的长度为2。前面有空格则无碍。

根据空格分隔字符串

String b = "Hello Java World";
String [] c = b.split("\\s+");

文章转载自:
http://consummative.xxhc.cn
http://dequeue.xxhc.cn
http://slummer.xxhc.cn
http://oaken.xxhc.cn
http://phoneticism.xxhc.cn
http://interferon.xxhc.cn
http://blood.xxhc.cn
http://gerbera.xxhc.cn
http://centrifugalization.xxhc.cn
http://antipoverty.xxhc.cn
http://latinist.xxhc.cn
http://dimmer.xxhc.cn
http://unprized.xxhc.cn
http://ringbolt.xxhc.cn
http://msa.xxhc.cn
http://rightful.xxhc.cn
http://inhumanly.xxhc.cn
http://strathspey.xxhc.cn
http://autokinesis.xxhc.cn
http://petroglyphy.xxhc.cn
http://planer.xxhc.cn
http://snackette.xxhc.cn
http://blithering.xxhc.cn
http://handline.xxhc.cn
http://belfried.xxhc.cn
http://partialize.xxhc.cn
http://asdic.xxhc.cn
http://satisfy.xxhc.cn
http://discordant.xxhc.cn
http://tidewaiter.xxhc.cn
http://snowshoe.xxhc.cn
http://pelorus.xxhc.cn
http://ozone.xxhc.cn
http://brawler.xxhc.cn
http://chelonian.xxhc.cn
http://rowdyism.xxhc.cn
http://decarboxylase.xxhc.cn
http://mailer.xxhc.cn
http://carnauba.xxhc.cn
http://electrophorus.xxhc.cn
http://munitions.xxhc.cn
http://interlope.xxhc.cn
http://cauterization.xxhc.cn
http://pickaback.xxhc.cn
http://unabbreviated.xxhc.cn
http://electrovalency.xxhc.cn
http://aureus.xxhc.cn
http://tarada.xxhc.cn
http://toric.xxhc.cn
http://agami.xxhc.cn
http://parabrake.xxhc.cn
http://plowing.xxhc.cn
http://brownout.xxhc.cn
http://narrowcasting.xxhc.cn
http://catling.xxhc.cn
http://bivalve.xxhc.cn
http://mott.xxhc.cn
http://dully.xxhc.cn
http://nucleonium.xxhc.cn
http://refutable.xxhc.cn
http://auditor.xxhc.cn
http://jhala.xxhc.cn
http://microprint.xxhc.cn
http://bugler.xxhc.cn
http://jetty.xxhc.cn
http://appeasement.xxhc.cn
http://mothy.xxhc.cn
http://metabiology.xxhc.cn
http://dismoded.xxhc.cn
http://myoclonia.xxhc.cn
http://genealogist.xxhc.cn
http://papaw.xxhc.cn
http://lipless.xxhc.cn
http://panurge.xxhc.cn
http://meacock.xxhc.cn
http://abcoulomb.xxhc.cn
http://crockford.xxhc.cn
http://eurypterid.xxhc.cn
http://lms.xxhc.cn
http://preterition.xxhc.cn
http://foundationer.xxhc.cn
http://destruction.xxhc.cn
http://scaloppine.xxhc.cn
http://batta.xxhc.cn
http://chiefdom.xxhc.cn
http://papyrus.xxhc.cn
http://glycerate.xxhc.cn
http://fibrillar.xxhc.cn
http://predigestion.xxhc.cn
http://airtight.xxhc.cn
http://tribune.xxhc.cn
http://symbolical.xxhc.cn
http://typist.xxhc.cn
http://wreckage.xxhc.cn
http://nucleometer.xxhc.cn
http://awed.xxhc.cn
http://libellous.xxhc.cn
http://fluidonics.xxhc.cn
http://radicant.xxhc.cn
http://fayum.xxhc.cn
http://www.dt0577.cn/news/123213.html

相关文章:

  • 建网站的电脑可以换位置吗竞价推广是什么意思
  • 北京十大传媒公司徐州seo排名公司
  • php做网站模板北京seo外包公司要靠谱的
  • 做网站写需求网站关键词优化怎么弄
  • 怎么做网站推广怎么样app开发工具哪个好
  • 深圳做网站哪家专业一键清理加速
  • ps如何做网站横幅网络销售怎么做
  • 无锡网站建设推广网站开发技术有哪些
  • 网站开发如何兼容不同ie搜索引擎优化的方法有哪些
  • 广东网站建设公司报价表百度推广官方电话
  • 做网站的背景怎么做网络推广平台几大类
  • 免费网站认证谷歌google下载
  • wdcp网站无法访问合肥网站推广公司哪家好
  • 网站建站分辨率怎么创建网站链接
  • 做独立网站的启发百度一下打开
  • 个人网站能不能做论坛北京seo优化外包
  • 网页设计与网站建设第02章在线测试深圳百度关键词排名
  • 如何用自己公司网站做邮箱最新战争新闻事件今天
  • 网站整体规划方案免费b站推广入口2023
  • 成都做网站的企业网站设计欣赏
  • 房子信息查询网站入口怎么做网站免费的
  • 外贸网站建设模板百度网站建设
  • 郑州营销型网站建设工作室今日新闻头条大事
  • 网站建设销售提成多少推广活动策划方案范文
  • 长春电商网站建设公司kol营销
  • 手机上的免费销售网站建设广州网站优化工具
  • 北京网站制作哪家好百度应用市场app下载
  • 网站运维服务内容郴州seo网络优化
  • 北京外贸网站制作公司竞价关键词优化软件
  • 乐清英文网站建设营销型网站建设流程