当前位置:网站首页>Hutool array tool
Hutool array tool
2022-07-27 18:09:00 【@Calm down】
// Array tool -ArrayUtil
@Test
public void arrayUtil(){
// Sentenced to empty
int[] a = {
1,2};
if (ArrayUtil.isNotEmpty(a)) {
System.out.println("very good");
}
// Array Clone
Integer[] b = {
1,2,3,4,5,6};
Integer[] cloneB = ArrayUtil.clone(b);
Assert.assertArrayEquals(b, cloneB);
// Ordered list generation
Console.log(ArrayUtil.range(1,6,2));
// Filter
Console.log(ArrayUtil.filter(b,c->c%2==0));
// Whether it contains elements
// ArrayUtil.contains Method only for generic arrays , Detects whether the specified element is in the array .
Console.log(ArrayUtil.contains(b,0));
// Array to string
Console.log(ArrayUtil.toString(b));
// Array to string ( Specify the separator )
Console.log(ArrayUtil.join(b,"-"));
}
边栏推荐
- Understand │ what is cross domain? How to solve cross domain problems?
- Likeshop takeout ordering system "100% open source without encryption"
- Kubernetes 1.24 high availability cluster binary deployment
- Count the six weapons of the domestic interface cooperation platform!
- Introduction to ef framework
- 快解析结合海典医药
- @Scheduled 和Quartz
- How to solve the error of ora-00955 when Oracle modifies the primary key
- 使用分布式框架WCF出现的BUG记录
- Salesforce dynamic dashboard dynamic reports, limitations and Solutions
猜你喜欢

Evaluation index of machine learning (I) -- regression evaluation index

Code compliance: five reasons why developers use helix QAC

2022 safety officer-a certificate examination questions and online simulation examination

Big gap? Requirements and conditions for candidates with different academic qualifications to take the postgraduate entrance examination

Convolutional neural network -- Introduction to FPN (feature pyramid networks)

Understand │ what is cross domain? How to solve cross domain problems?

知物由学 | 从0到1搭建实时反外挂机制,多维度补充手游攻防力

最新大厂高级面试题 必备

公网域名如何解析到内网IP服务器——快解析域名映射外网访问

WPF做登陆界面
随机推荐
Fast analysis combined with Haidian medicine
Operation of simulated examination platform for 2022 low voltage electrician examination questions
Personal understanding of convolution calculation process of convolution neural network
JS to realize the right-click menu bar function
注释中的{@code}、{@Link} 与<p>等标签
Six relationships of classes -- the difference between dependency and Association
Learn from things | Yidun mobile terminal isomorphism practice, improve the official website interaction experience in a few steps
I got the P8 "top-level" distributed architecture manual crazy spread on Alibaba intranet
Behind every piece of information you collect, you can't live without TA
JDBC connection database reading foreground cannot display data
Dbeaver connection MySQL error: the server time zone value 'Ö Ð¹ ú±ê ×¼ ʱ ¼ ä‘ is unrecognized or represents more than
Notes on standardized management of "ancestral warehouse" of meituan meal
fragmentTransaction.replace第二个参数报错
Yyds dry inventory interview must brush top101: specified interval reversal in the linked list
卷积神经网络——SSD论文翻译
[introduction to database system (Wang Shan)] Chapter 1 - Introduction
js实现右键菜单栏功能
卷积神经网络——YOLOV2(YOLO9000)论文翻译
卷积神经网络——FPN(Feature Pyramid Networks)介绍
Layout of flutter