I was trying to replace every letter in a string with an asterix using Dart and am having some difficulty. In Javascript it is:
'test'.replace(/./g, '*');
So in Dart, I tried the following:
'test'.replaceAll(new RegExp(r'/.'), '*');
'test'.replaceAll(new RegExp(r'\/.'), '*');
'test'.replaceAll(new RegExp(r'/./'), '*');
'test'.replaceAll(new RegExp(r'\/.\/'), '*');
I obviously don't quite understand how this should work as cannot seem to make this work.
Can anyone advise the correct way to do this with a short explanation?
Thanks.