Given an email-string as below
String email = "[email protected]"
I’d like to show in my Flutter code a censored string, e.g:
"na******[email protected]"
I tried email.replaceRange(2, email.length, "*" * (email.length - 2))
with output:
"na******************"
I’d like to stop the censorship before @, maybe 2 or 3 characters before.
2
Answers
result :
You can use this method to achieve what you want exactly: