Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Regular-expressions/Dart/regular-expressions.dart
Normal file
10
Task/Regular-expressions/Dart/regular-expressions.dart
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
RegExp regexp = new RegExp(r'\w+\!');
|
||||
|
||||
String capitalize(Match m) => '${m[0].substring(0, m[0].length-1).toUpperCase()}';
|
||||
|
||||
void main(){
|
||||
String hello = 'hello hello! world world!';
|
||||
String hellomodified = hello.replaceAllMapped(regexp, capitalize);
|
||||
print(hello);
|
||||
print(hellomodified);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue