摘要: 使用split进行字符串分割时需要注意2点 1、特殊字符作为分隔符时需要使用\\进行转义(如\\ -> \\\\; | -> \\| ) 特殊字符 .$|()[{^?*+\\ 例如对"|"分隔 未转义 String str = "01|02|03"; String[] strArr = str.sp 阅读全文
posted @ 2020-06-29 16:05 天天代码码天天 阅读(10) 评论(0) 推荐(0) 编辑
摘要: @Component public class Config { @Value("${config1}") private static String config1; } 使用上面这种方式,config1会返回null 正确写法 @Component public class Config { p 阅读全文
posted @ 2020-06-29 09:46 天天代码码天天 阅读(8) 评论(0) 推荐(0) 编辑