【问题标题】:Replace “” in AutoHotkey替换 AutoHotkey 中的“”
【发布时间】:2018-10-10 14:36:46
【问题描述】:

这是我必须从文本文件中处理的一种奇怪的双引号:

这是我的剪贴板管理文本的方式:

II=" alt="“”" />][N

重点是:我正在尝试使用StrReplace() 检测该字符串并替换它,但它没有找到我的剪贴板通过复制和粘贴获得的内容。

这找不到任何东西可以用foo代替:

fixedContent := StrReplace(myContent, "II="" alt=""“”"" />][N", "foo")

好像“”不一样。

也许我必须使用特殊字符?

【问题讨论】:

    标签: string replace autohotkey double-quotes


    【解决方案1】:

    字符“” 相同,只是字体不同。

    myContent = <IT="" alt="“”" />][Nebula]
    find = IT="" alt="“”" />][N
    replaceWith = foo
    fixedContent := StrReplace(myContent, find, replaceWith)
    msgbox % fixedContent
    

    【讨论】:

      【解决方案2】:

      试试这个

      fixedContent:=StrReplace(myContent, "“”", "foo")
      

      【讨论】:

      • 我按照StrReplace() 示例的建议使用了反引号,但这并不能胜任。
      • 能否提供原文字符串(不是图片)?您是否已经搜索过这些字符的 ascii 编号?
      • 我不熟悉 ASCII 数字之类的东西。要在这里包含原始文本字符串我必须复制和粘贴,最终结果与上面相同:我不知道如何在不使用生成“”的剪贴板的情况下为您提供原始文本字符串...
      • 我更正了我的第一个答案,只需使用上面的行。
      • 它不起作用:(它忽略了"“”",好像没有找到它一样。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-15
      • 2015-11-26
      • 1970-01-01
      相关资源
      最近更新 更多