InStr和StrReverse [英] InStr and StrReverse
问题描述
您好(来自新手),
我有一个图像数据库,可以提取文件的副本(将链接存储在数据库中)。图像显示在我的子表单中。然后,我在一个名为图像描述的控件中显示文件的名称,但是,它显示了整个链接:
D:\ imageDogs \ChestertheDog.jpg
我正在为StrRevers(InStr)J寻找好的示例代码,所以我可以以某种方式反转字符串,切断''ChestertheDog.jpg并仅在控件中显示ChestertheDog。我还有另一个控制盒,我想要.jpg部分去。
有没有人做过这样的事情?帮助......我一直在玩网上的样本而不是工作。谢谢
Rosie
Hello (from a newbie),
I have an image database that pulls in a copy of a file (stores the link in database). The image shows up in my subform. I then show the name of file in a control called image description, however, it shows the entire link:
D:\imageDogs\ChestertheDog.jpg
I''m looking for good example code for StrRevers (InStr)J, so I can somehow reverse the string, cut off the ''ChestertheDog.jpg and display only the ChestertheDog in the control. I also have another control box which I''d like the ''.jpg'' portion to go to.
Has anyone done something like this? Help...I''ve been playing around with samples from the Web and nothings working. thanks
Rosie
推荐答案
您好(来自新手),
我有一个图像数据库,可以提取文件的副本(将链接存储在数据库中)。图像显示在我的子表单中。然后,我在一个名为图像描述的控件中显示文件的名称,但是,它显示了整个链接:
D:\ imageDogs \ChestertheDog.jpg
我正在为StrRevers(InStr)J寻找好的示例代码,所以我可以以某种方式反转字符串,切断''ChestertheDog.jpg并仅在控件中显示ChestertheDog。我还有另一个控制盒,我想要.jpg部分去。
有没有人做过这样的事情?帮助......我一直在玩网上的样本而不是工作。谢谢
Rosie
Hello (from a newbie),
I have an image database that pulls in a copy of a file (stores the link in database). The image shows up in my subform. I then show the name of file in a control called image description, however, it shows the entire link:
D:\imageDogs\ChestertheDog.jpg
I''m looking for good example code for StrRevers (InStr)J, so I can somehow reverse the string, cut off the ''ChestertheDog.jpg and display only the ChestertheDog in the control. I also have another control box which I''d like the ''.jpg'' portion to go to.
Has anyone done something like this? Help...I''ve been playing around with samples from the Web and nothings working. thanks
Rosie
嗨!
已解决类似问题在批量文件重命名前一段时间我写了类FileFullPath。我附上代码。
类模块FileFullPath:
Hi!
Having dealed with a similar issue on batch file renaming some time ago I have written Class "FileFullPath". Hereby I attach the code.
Class module "FileFullPath":
嗨!
前一段时间我在批处理文件重命名时遇到了类似的问题,我写了类 ; FileFullPath" ;.我附上代码。
类模块FileFullPath:
Hi!
Having dealed with a similar issue on batch file renaming some time ago I have written Class "FileFullPath". Hereby I attach the code.
Class module "FileFullPath":
您好(来自新手),
我有一个图像数据库可以拉入文件的副本(将链接存储在数据库中)。图像显示在我的子表单中。然后,我在一个名为图像描述的控件中显示文件的名称,但是,它显示了整个链接:
D:\ imageDogs \ChestertheDog.jpg
我正在为StrRevers(InStr)J寻找好的示例代码,所以我可以以某种方式反转字符串,切断''ChestertheDog.jpg并仅在控件中显示ChestertheDog。我还有另一个控制盒,我想要.jpg部分去。
有没有人做过这样的事情?帮助......我一直在玩网上的样本而不是工作。谢谢
Rosie
Hello (from a newbie),
I have an image database that pulls in a copy of a file (stores the link in database). The image shows up in my subform. I then show the name of file in a control called image description, however, it shows the entire link:
D:\imageDogs\ChestertheDog.jpg
I''m looking for good example code for StrRevers (InStr)J, so I can somehow reverse the string, cut off the ''ChestertheDog.jpg and display only the ChestertheDog in the control. I also have another control box which I''d like the ''.jpg'' portion to go to.
Has anyone done something like this? Help...I''ve been playing around with samples from the Web and nothings working. thanks
Rosie
要简单地解析文件路径,只返回没有扩展名的基本文件名,只需要几行代码。如果您愿意,也许可以将其合并到您的代码中:
To simply parse the File Path, and return only the Base File Name without the Extension, only requires a couple of lines of code. Maybe you can incorporate this into your code, if you so desire:
这篇关于InStr和StrReverse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!