loading...

re: Daily Challenge #276 - Unwanted Dollar Signs VIEW POST

TOP OF THREAD FULL DISCUSSION
re: My solution in Typescript const remove_dollar = (input: string) => Number(input.replace(/\$|\s/g, ""));
 

I like this but I will do it without /g as you will encounter this replacement at the most once. Also space after $ maybe present or may not be so /\$?\s?/ would do I guess. What do you think?

code of conduct - report abuse