js replace all & replaceAll

https://scotch.io/tutorials/javascript-replace-all-instances-of-a-string

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

replaceAll

https://developer.mozilla.org/en-US/search?q=replaceAll


view1.axis('date', {
title: false,
// label: {
// // offset: 40,
// autoRotate: true,
// textStyle: {
// // textAlign: 'start',
// // textAlign: 'end',
// // textAlign: 'middle',
// textAlign: 'center',
// // textAlign: 'right',
// // textAlign: 'left',
// // marginLeft: -100,
// rotate: 45,
// },
// },
label: {
// 使用 formatter 回调函数
formatter: val => {
// return val + '元';
// return val.replace(`-`, `/`);
// replaceAll
return val.replace(/-/ig, `/`);
}
}
});

replaceAll & non-global RegExp

ncaught TypeError: String.prototype.replaceAll called with a non-global RegExp argument at String.replaceAll

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll


let s = `A man, a plan, a canal: Panama`; // all === g
s.replace(/[^0-9a-zA-Z]/g, ``);
// "AmanaplanacanalPanama" // once
s.replace(/[^0-9a-zA-Z]/, ``);
// "Aman, a plan, a canal: Panama" // not set global
s.replaceAll(/[^0-9a-zA-Z]/, ``);
// Uncaught TypeError: String.prototype.replaceAll called with a non-global RegExp argument // global falg === g
s.replaceAll(/[^0-9a-zA-Z]/g, ``);
// "AmanaplanacanalPanama"

https://leetcode.com/submissions/detail/368182883/


shit G2 API docs

https://www.yuque.com/antv/g2-docs/tutorial-axes#8b47b027

g2 文档好神奇,没有的值也能用


https://www.yuque.com/antv/g2-docs/tutorial-g2-chart-composition

https://www.yuque.com/antv/g2-docs/tutorial-creating-chart



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. 跟着老男孩教育学Python开发【第三篇】:Python函数
  2. ubuntu下面更改用户名的方法
  3. ionic 白屏
  4. ORA-12637解决问题
  5. Redis 常用链接
  6. .net网站能走多远
  7. 利用javascript实现课程选择
  8. Spring-RMI固定端口
  9. JVM调优-Java垃圾回收之分代回收
  10. MEF 编程指南(八):过滤目录
  11. 【HDOJ】4261 Estimation
  12. vs2010+ Ankhsvn使用详解
  13. codeforces 604B More Cowbell
  14. Sqoop简介及安装
  15. 201521123091 《Java程序设计》第12周学习总结
  16. SSH2三大框架SQL查询
  17. extjs 中比较常见且好用的监听事件
  18. 清除cookie
  19. 洛谷p1091合唱队形题解
  20. 腾讯云Ubuntu安装可视化桌面

热门文章

  1. Webpack4.0各个击破(8)tapable篇
  2. SpringMVC听课笔记(SpringMVC 表单标签 & 处理静态资源)
  3. Language Guide (proto3) | proto3 语言指南(九)Oneof结构
  4. Java——对象和类
  5. java架构《并发线程基础一》
  6. python模块----sys模块 (系统相关的参数和函数)
  7. PHP-mysql存储照片的两种方式
  8. pytest测试框架+jenkins结合pytest+jenkins邮件通知配置
  9. jquery each报 Uncaught TypeError: Cannot use 'in' operator to search for错误
  10. 设计模式(十)——组合模式(HashMap源码解析)