2011-03-03 70 views
-1

varitem = match.SubMatches(1) varitemthis = p_variables_list.Item(varitem)结果的没有结果ASP REPLACE函数

response.write match.Value &" "& varitemthis &" "&varitem & "<br>" 

{{name}} rrrr name 
{{site_root}} www.site.com/ site_root 
{{mail}} [email protected] mail 
{{code}} code 

结果

p_template = Replace(p_template, match.Value, varitem) 
response.write p_template 

没事,但

p_template = Replace(p_template, match.Value, varitemthis) 
response.write p_template 

什么......为什么?怎么了?

+0

您需要提高您的问题的可读性。 – smartcaveman 2011-03-03 18:51:13

回答

1

几件事情......

记住替换功能是区分大小写的

不要通过确保您有价值观的一些基本故障排除。


Response.Write "Original p_template = " & p_template 
Response.Write "match.Value = " & match.Value 
Response.Write "varitemthis = " & varitemthis 

p_template = Replace(p_template, match.Value, varitemthis) 

Response.Write "New p_template = " & p_template 
+0

谢谢!只是这项工作! varitemthis = varitemthis&“” – 2011-03-05 09:50:10

0

在传统的ASP的更换功能不区分大小写。