2011-03-03 32 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的更換功能不區分大小寫。