![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
String
Frank-fu
这个作者很懒,什么都没留下…
展开
-
判断是否为空
import org.apache.commons.lang3.StringUtils; import java.util.Collection; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 基础数据校验 * * @author frank * @module * @date 2021/9/4 13:51 */ public class EmptyUt.原创 2021-09-04 14:42:25 · 214 阅读 · 0 评论 -
String之equals与==
String之equals与==前提作用示例结果结果分析 前提 在String中equals与==区别 作用 equals比较内容是否相等 ==比较地址 示例 public static void main(String[] args) { String str1 = "hello"; String str2 = "hello"; System.out.println(" str1==str2: "+(str1==str2)); System.out.prin原创 2020-08-27 13:52:13 · 110 阅读 · 0 评论 -
String之equals
String之equals前提作用业务逻辑源码分析 前提 作用 String类型比较内容的值是否相等 业务逻辑 比较两个对象的地址是否相等,返回true 如果比较对象不是String类型,否则返回false 被比较对象的值长度的与比较对象的值长度相等,否则返回false 循环比较每一个字符,如果相等返回true,否则返回false 源码分析 /** * Compares this string to the specified object. The result is {@code * tr原创 2020-08-27 11:24:18 · 125 阅读 · 0 评论