unicode换行符
发表于|更新于
|浏览量:
良好的教养在于隐藏我们对自己较佳的评价,以及隐藏我们对他人较差的评价——马克吐温
挺有趣的:
1 | String words = "哈哈"; |

以下语句输出

因为\u000d换行符被解析了
相关推荐
2021-10-23
ThreadLocal子线程共享
世人缺乏的是毅力,而非气力。——雨果 昨天聊了ThreadLocal可以用作单个线程中变量共享 其底层实现其实就是个Map,用线程作为key,不信可以看这部分源码: 123456789101112131415161718192021/** * Returns the value in the current thread's copy of this * thread-local variable. If the variable has no value for the * current thread, it is first initialized to the value returned * by an invocation of the {@link #initialValue} method. * * @return the current thread's value of this thread-local */public T get() { Thread t = Thread.currentThr...
2020-11-21
mybatis-plus基本使用
如果一个人不知道他要驶向哪个码头,那么任何风都不会是顺风。——小塞涅卡 上回我们写到封装了axios的工具类 今天我把OSS上传文件接了,可以去项目目录自取 前端项目:https://gitee.com/VampireAchao/my-vue-app.git 后端项目:https://gitee.com/VampireAchao/simple-springboot.git 传统代码以点到为止,所以这里就不再多聊OSS,想了解可以看这篇博客 然后我们聊聊mybatis-plus的基本使用 首先引入依赖,这个没什么好说的 12345<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.1.0</version></dependency> 然后我们按照之前创的表去对应新建一个DO 因为之前我们的表结构为这样【T...
2022-03-04
replace、replaceAll、replaceFirst
一年好景君须记,最是橙黄橘绿时。——苏轼 聊聊这仨很常用的函数 我相信很多人也跟我一样也有个误区,错把replace当成replaceFirst,把replaceAll当成replace 实际上,replace函数会替换掉满足字符串中所有出现过第一个参数中的值的地方 例如: 1234 String string = "ruben love strawberry"; String replace = string.replace("r", "");// uben love stawbey 如果我们只需要替换第一处,则需要使用replaceFirst 例如: 1234 String string = "ruben love strawberry"; String replaceFirst = string.replaceFirst("[A-Za-z0-9]", "");// uben love strawberry 并...
2024-09-09
Apache-ShenYu支持namespace功能(四)
教育的最高目标不是知识而是行动。——斯宾塞 本次适配是将几个页面的namespace选择框隐藏了,然后对data-permission数据权限配置弹框里添加了一个namespace选择框,并在内部切换namespace时候刷新表格 PR链接: https://github.com/apache/shenyu-dashboard/pull/479 隐藏namespace的逻辑很简单,首先用withRouter将react组件和dvajs的路由绑定: 1import { withRouter } from "dva/router"; 然后绑定: 1export default withRouter(GlobalHeader); 然后从props里取出当前路由 1const { location: { pathname } } = this.props; 进行判断,当不在下列路由里时,showNamespaces为true 12345678const showNamespaces = !~[ ...
2022-06-24
opencc4j
“不用给我爱,不用给我钱,不用给我声誉,给我真理吧。我们应该有勇气去面对真实的内心,即使前面荆棘满地,也要坚定地走下去。为了不浪费你的这一辈子。”——梭罗《瓦尔登湖》 分享一个java简繁转换的库opencc4j https://github.com/houbb/opencc4j Group ArtifactId Version 12345<dependency> <groupId>com.github.houbb</groupId> <artifactId>opencc4j</artifactId> <version>1.7.2</version></dependency> 使用起来: 繁简体转换转为简体123String original = "生命不息,奮鬥不止";String result = ZhConverterUtil.toSimple(original);Assert.assertEquals("生命不息,奋斗不止...
2023-12-29
spring-gateway跨域坑
没有不可认识的东西,我们只能说还有尚未被认识的东西。——高尔基 今天发现一个问题,前端跨域,这个我已经解决无数次了,但上了个网关,还是踩坑了 首先是网关配置了跨域 12345678910@Beanpublic CorsWebFilter corsFilter() { CorsConfiguration config = new CorsConfiguration(); config.addAllowedOriginPattern("*"); config.addAllowedHeader("*"); config.addAllowedMethod("*"); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", config); return new CorsWe...
