当前位置:网站首页>dart:字符串replace相关的方法
dart:字符串replace相关的方法
2022-06-30 15:48:00 【InfoQ】
replaceAll
void main() {
var a = '大前端️之旅️';
var b = '大前端️';
print(a.replaceAll('️', ''));
print(b.replaceAll(RegExp(r'(️)'), ''));
}

replaceAllMapped
String replaceAllMapped(
Pattern from,
String replace(Match match)
)
void main() {
var a = '大前端️之旅️';
var b = '大前端️';
print(a.replaceAllMapped('️', (Match m) => ''));
print(b.replaceAllMapped(RegExp(r'️'), (Match m) => ''));
}

replaceFirst
String replaceFirst(
Pattern from,
String to,
[int startIndex = 0]
)
void main() {
var d = '大前端之旅';
print(d.replaceFirst(RegExp(r'\大'), 'jianguo', 0)); //1ccc3
}

4.replaceFirstMapped
String replaceFirstMapped(
Pattern from,
String replace(Match match),
[int startIndex = 0]
) var e = 'asd';
print(e.replaceFirstMapped(RegExp(r'\w'), (Match m) => '${m[0]}${m[0]}', 2),);//asdd5.replaceRange
String replaceRange(
int start,
int end,
String replacement
)
var f = '123456789';
print(f.replaceRange(1, 3, 'replace')); //1replace456789
边栏推荐
- Arcmap操作系列:80平面转经纬度84
- Mysql8 error: error 1410 (42000): you are not allowed to create a user with grant solution
- On July 2, I invited you to TD Hero online conference
- 【活动报名】探秘元宇宙,就差你了!7月2号我在深圳现场等你!
- Good partner for cloud skill improvement, senior brother cloud of Amazon officially opened today
- I implement "stack" with C I
- Bidding announcement: Taizhou Unicom Oracle all in one machine and database maintenance service project in 2022
- MySQL transaction / lock / log summary
- simpleITK读取nii遇到ITK only supports orthonormal direction cosines的错误
- Lambda expression_ Stream stream_ File class
猜你喜欢

Mathematical modeling for war preparation 33- grey prediction model 2

【Verilog基础】关于Clock信号的一些概念总结(clock setup/hold、clock tree、clock skew、clock latency、clock transition..)
![[wechat applet] the hosting environment of the applet](/img/ee/0f1dee4a26eb62c2268484c1b59edf.png)
[wechat applet] the hosting environment of the applet

备战数学建模36-时间序列模型2

Anaconda下安装Jupyter notebook

【牛客网刷题系列 之 Verilog快速入门】~ 位拆分与运算

Etcd教程 — 第八章 Etcd之Compact、Watch和Lease API
Two methods for MySQL to open remote connection permission
![[wechat applet] basic use of common components (view/scroll-view/wiper, text/rich-text, button/image)](/img/3b/05dbf03024088c5f94363f157a1701.png)
[wechat applet] basic use of common components (view/scroll-view/wiper, text/rich-text, button/image)

7 月 2 日邀你来TD Hero 线上发布会
随机推荐
Build cloud native observability capability suitable for organizations
Bc1.2 PD protocol
HMS Core音频编辑服务3D音频技术,助力打造沉浸式听觉盛宴
Installing jupyter notebook under Anaconda
Hologres共享集群助力淘宝订阅极致精细化运营
POJ Project Summer
register_ Chrdev and CDEV_ init cdev_ Add usage differences
php7.3 centos7.9安装sqlserver扩展
IO stream_ recursion
[Verilog basics] octal and hexadecimal representation of decimal negative numbers
Wechat emoticons are written into the judgment, and the OK and bomb you send may become "testimony in court"
Two methods for MySQL to open remote connection permission
[Verilog basics] summary of some concepts about clock signals (clock setup/hold, clock tree, clock skew, clock latency, clock transition..)
附加:(还没写,别看~~~)WebMvcConfigurer接口;
抖快B为啥做不好综艺
Bidding announcement: Tianjin housing provident fund management center database all-in-one machine and database software project (budget: 6.45 million)
Asp. NETCORE uses cache and AOP to prevent repeated commit
MC Instruction Decoder
利用PIL进行不失真的resize
Mysql8.0 method and steps for enabling remote connection permission