Skip to content

Error: Property 'replaceAll' does not exist on type 'string' #2826

Answered by Raulcarvalhomelo
BeyersNel asked this question in Q&A
Discussion options

You must be logged in to vote

You may solve the problem using RegExp and global flag. The global flag is what makes replace run on all occurrences.

"1399/06/08".replace(///g, "_") // "1399_06_08"

https://www.thecodeteacher.com/question/80066/angular---Property-'replaceAll'-does-not-exist-on-type-'string'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BeyersNel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants