mowandao1985 发表于 2010-8-27 16:41:38

检查的字符串中包含有双引号怎么办?

当我检查一个字符串的内容是,字符中包含有双引号怎么办?
如:
字符串:Part NumberLayers 1 2 3 4 5 6 Thickness(mm) 0.1mm/0.0039" 0.2mm/0.0079" 0.3mm/0.012" Other Dimension* X cm inch mm per Piece Panel (base on Gerber file) Material Polyimide。
我在网上查到了两个方法都不行:
1、chr(34)为双引号,把字符串写成如下:
art NumberLayers 1 2 3 4 5 6 Thickness(mm) 0.1mm/0.0039"&chr(34)&" 0.2mm/0.0079"&chr(34)&"0.3mm/0.012"&chr(34)&“Other Dimension* X cm inch mm per Piece Panel (base on Gerber file) Material Polyimide
2、在双引号后面增加一个双引号如:
Part NumberLayers 1 2 3 4 5 6 Thickness(mm) 0.1mm/0.0039"" 0.2mm/0.0079"" 0.3mm/0.012"" Other Dimension* X cm inch mm per Piece Panel (base on Gerber file) Material Polyimide。
请各位朋友帮帮忙!

xhhuang1618 发表于 2010-8-27 17:19:40

回复 1# 的帖子

art NumberLayers 1 2 3 4 5 6 Thickness(mm) 0.1mm/0.0039 &chr(34)&0.2mm/0.0079 &chr(34)& 0.3mm/0.012 &chr(34)& Other Dimension* X cm inch mm per Piece Panel (base on Gerber file) Material Polyimide
---chr(34)应该这么用

blizzardlyk 发表于 2010-8-28 02:09:11

str = "Part NumberLayers 1 2 3 4 5 6 Thickness(mm) 0.1mm/0.0039"&chr(34)&" 0.2mm/0.0079"&chr(34)&" 0.3mm/0.012"&chr(34)&" Other Dimension* X cm inch mm per Piece Panel (base on Gerber file) Material Polyimide"
感觉这应该是个细致活,仔细点应该没错啊

blizzardlyk 发表于 2010-8-28 02:11:05

str = "Part NumberLayers 1 2 3 4 5 6 Thickness(mm) 0.1mm/0.0039"&chr(34)&" 0.2mm/0.0079"&chr(34)&" 0.3mm/0.012"&chr(34)&" Other Dimension* X cm inch mm per Piece Panel (base on Gerber file) Material Polyimide"

mowandao1985 发表于 2010-8-30 17:15:22

原帖由 xhhuang1618 于 2010-8-27 17:19 发表 http://bbs.51testing.com/images/common/back.gif
art NumberLayers 1 2 3 4 5 6 Thickness(mm) 0.1mm/0.0039 &chr(34)&0.2mm/0.0079 &chr(34)& 0.3mm/0.012 &chr(34)& Other Dimension* X cm inch mm per Piece Panel (base on Gerber file) Material Polyimide
...
这样用不行啊,会报如下错误:
Run Error 缺少语句
Line (1): "&chr(34)&".

mowandao1985 发表于 2010-8-30 17:19:35

原帖由 mowandao1985 于 2010-8-30 17:15 发表 http://bbs.51testing.com/images/common/back.gif

这样用不行啊,会报如下错误:
Run Error 缺少语句
Line (1): "&chr(34)&".
我搞错了,是直接输出:&chr(34)&

mowandao1985 发表于 2010-8-30 17:21:40

blizzardlyk说得对,这确实是个细致的活儿,我的想法是正确的,可能就是编写的时候出来问题。
看来以后还是得细心点才行了。
谢谢你们的帮助!
页: [1]
查看完整版本: 检查的字符串中包含有双引号怎么办?