当前位置:网站首页>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,"-"));
}
边栏推荐
- How to improve the security of Android applications?
- canvas根据坐标点绘制图形
- Convolutional neural network -- Translation of yolov1 thesis
- golang 自定义once,当出现error第二次重新设置
- In the first week of June, risk control of e-shield business paid attention to 15 institutions such as New Oriental XRS, which were fined
- MySQL creates a student table and queries grades
- Behind every piece of information you collect, you can't live without TA
- Knowledge dry goods: basic storage service novice Experience Camp
- hutool- 数组工具
- JSP custom tag (bottom)
猜你喜欢

Notes on standardized management of "ancestral warehouse" of meituan meal

Convolutional neural network -- Translation of yolov1 thesis

Learn from things | Yidun mobile terminal isomorphism practice, improve the official website interaction experience in a few steps

Profiles vs Permission Sets

Numpy array matrix operation

Convolutional neural network -- from r-cnn, fast r-cnn to fast r-cnn, mask r-cnn

类的六大关系——依赖和关联的区别

Convolutional neural network -- Translation of yolov2 (yolo9000) papers

Run loam_ Velodyne real-time mapping

JSP custom tag (bottom)
随机推荐
Common shell commands (1) -- variable case conversion
TCP的连接状态标识 (SYN, FIN, ACK, PSH, RST, URG)
js实现页面或DOM元素平滑滚动
【cf】#681 A. Kids Seating (Div. 2, based on VK Cup 2019-2020 - Final)
2022 safety officer-a certificate examination questions and online simulation examination
XStream reports an error abstractreflectionconverter$unknownfield exception when parsing XML
The global cloud market is growing rapidly, and data security has entered a strong regulatory era of rule of law
Help, boost and take responsibility, the new value and significance of the 6th Tuba rabbit 718 national home decoration Festival
Convolutional neural network -- from r-cnn, fast r-cnn to fast r-cnn, mask r-cnn
golang 自定义once,当出现error第二次重新设置
Using the vlookup method in salesforce validation rule
MySQL 中 You can‘t specify target table ‘表名‘ for update in FROM clause错误解决办法
微信小程序 实现位置地图显示,引入map地图,不含导航
快解析结合海典医药
Evaluation index of machine learning (I) -- regression evaluation index
Run loam_ Velodyne real-time mapping
【Codeforces】 A. Computer Game
卷积神经网络——从R-CNN,Fast R-CNN到Faster R-CNN,Mask R-CNN
微信小程序 实现拨打电话
WebDriverException( selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executabl