Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- final phone = '+55 85 88888-8888';
- final replacement = phone.replaceAllMapped(
- RegExp(r'(\d*)\s(\d*)\s(\d*)\-(\d*)'),
- (match) =>
- '${match[1]} ${match[2]} ${match[3]?.replaceAll(RegExp(r'\d'), '*')}-${match[4]}',
- );
- print(phone);
- print(replacement);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement