I'm trying to determine if a value matches a string input by the user. When trying to match a dollar sign, I take the input string and replace the dollar sign with an escaped dollar sign ("\\\\$"). However, this doesn't match, but it will match if instead of assigning this value to a variable I just use the literal string. Here's a console snapshot illustrating this:
why is this happening??
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.