Recommended: Example analysis program to capture weather forecast When I was working in the company in the morning, I saw snow falling outside. The first snow in 2008 was a little later than before. Haha, cold
When we are building ASP websites, query is often the most basic function, but we know that single quotes are used to represent character-type data in ASP query statements, and must be used in double use. If only one single quote is used, there will definitely be an error. Regarding this phenomenon, I provide my solution below.In fact, in ASP, if there are single quotes in the keywords to be queryed, you only need to use two single quotes to represent them. For example, if the keyword that needs to be queryed is 'htmer, then we only need to enter ' 'htmer and we can query it. However, the user does not know that it takes two inputs to enter a single quote. We only need to use the replace function to replace the user with a single quote with two single quotes. The specific code is as follows:
replace(request(key), ', ' ')
Share: ASP returns the last location of a string % dwwwStr= divdwww.cn/divdivwww.dwww.cn/div Design Home dwwwStr= InStrRev(dwwwStr,/div) response.write dwwwStr % InstrRev Description Returns the position from the end of a string that appears in another string. Syntax InstrRev(string1, string2[, start[, compare]]) InstrRe