I want to replace/censor the characters of a username in elixir. So in the end, it should looks like in the bidders list in ebay:
in elixir there is the String replace function, but i am a newbe at regex and i dont know what elixir-regex supports. so how can i achieve this?
iex> String.replace("username1234", someregex, "***")
"u***4"
While you surely might accomplish this with regex “replace all but the first and the last symbols”
I’d better go with
String.slice/3
or
String.graphemes/1