erlang实现字符串某个字符替换 firecat全宏 2021-05-18 486 阅读1分钟 replvar(S, _Var, undefined) -> S; replvar(S, Var, Val) ->\ re:replace(S, Var, Val, [global, {return, list}]). start(Type) -> Topic = replvar(Type, "_", "-"), io:format("topic is a: ~p~n", [Topic]).\