已解决 如何删除一串字符的引号
本帖最后由 wgboy 于 2010-11-22 11:40 编辑如"C:\Program Files\Symantec\LiveUpdate",怎么去除双引号?小弟不才,用了下面笨方法。看那位大哥,能精简代码。不知道 有没有正则表达示可否实现。
$SoftwareInstallLocation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $var, "InstallLocation")
$result = StringInStr($SoftwareInstallLocation, '"')+1
$SoftwareInstallLocation = StringMid($SoftwareInstallLocation, $result)
$result=StringInStr($SoftwareInstallLocation, '"')-1
If $result<>-1 then
$SoftwareInstallLocation = StringLeft($SoftwareInstallLocation, $result)
EndIf StringRegExpReplace($test,'"',"")
shenrenba 发表于 2010-11-22 11:30 http://www.autoitx.com/images/common/back.gif
中文引号行不行得通啊? 如果只为了去除引号可以用stringreplace,否则用正则去除前后的引号.
$s='"C:\Program Files\Symantec\LiveUpdate"'
msgbox(0,'普通',stringreplace($s,'"',''))
msgbox(0,'正则',stringregexpreplace($s,'^\"(.+)\"$','$1')) 回复 3# ahphsautoit
StringRegExpReplace($test,'"|“',"") 回复 5# shenrenba
谢谢哦,我没有测试,只是问了问,谢谢哈!
页:
[1]