I recently stumbled on this issue that, though ran well on iOS, could not run on Android, even though I use the same code base and run them in parallel.
Note that (number + '') always returns a string, and this code runs on iOS.
Trying the regex with the global flag "g":
like some suggested StackOverFlow answers does not work either.
Can you guys guess the reasons and provide solutions?
Alternative way to do this with the
replace method works perfectly in the latest React Native version. Please note you need to use string literals (`) instead of quotes (") for string variables.
Tested on the following React Native version:
react-native-cli: 2.0.1 react-native: 0.64.3