从字符串中删除数值

Bit*_*ise 1 elixir

如果给出这个字符串'Cool1, let's g3et to work',我怎么能返回这个值Cool, let's get to work?与Elixir?

到目前为止,我一直试图用Regex来解决这个问题.谢谢!

duk*_*ave 6

用途String.replace:

String.replace("Cool1, let's g3et to work", ~r/\d/, "")
Run Code Online (Sandbox Code Playgroud)

\d装置的任何数字(又名数字值).