本文介绍了通过与扩展进行比较来测试模式是否是.jpg或.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将图像文件写入一个文件,将(xml和html)写入另一个文件中的公共文件中。我试图比较扩展,如果它是.jpg或.bmp它将写入图像文件,如果它是.html或.xml它将被写入应用程序文件。但我无法做到所以我的代码如下:
展开 | 选择 | Wrap | 行号 解决方案展开 | 选择 | Wrap | 行号
您可以将搜索脚本简化为此: 展开 | 选择 | Wrap | 行号
嗯...... Rajiv发布的内容更加清晰,并且做得非常好。
I need to write the image files in one file and (the xml and html) in another file from a common file. I am trying to compare the extensions,like if it is .jpg or .bmp it will be written to the image file and if it is .html or .xml it will be written to the app file.But I am not able to do so.My code is given below
Expand|Select|Wrap|Line Numbers 解决方案 Expand|Select|Wrap|Line NumbersYou can simplify your search script to this: Expand|Select|Wrap|Line NumbersWell...what Rajiv has posted is even more crisp and very well do the job.更多推荐
通过与扩展进行比较来测试模式是否是.jpg或.xml
发布评论