Re: Stripping letters from filename
- From: "Phill W." <p-.-a-.-w-a-r-d-@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Jul 2007 09:16:40 +0100
Benway wrote:
I have a file name like Eng-Cat-01-01-01.txt. I need to do a loop that starts stripping the letters from the front of this file name (which I'll store as a variable) until it reaches the "Cat" part. So I would have a variable "Cat-01-01-01.txt" that I can use to build up another string.
Dim sFilename As String _
= "Eng-Cat-01-01-01.txt"
Dim iPos as Integer _
= sFilename.Indexof( "Cat" )
If iPos > -1 Then
? sFilename.SubString( 0, iPos )
? sFilename.SubString( iPos + "Cat".Length() + 1 )
' or thereabouts ...
HTH,
Phill W.
.
- Follow-Ups:
- Re: Stripping letters from filename
- From: Benway
- Re: Stripping letters from filename
- References:
- Stripping letters from filename
- From: Benway
- Stripping letters from filename
- Prev by Date: Re: Disable 'continue' option when an unhandled exception occurs?
- Next by Date: Re: Opening MDI childforms
- Previous by thread: Stripping letters from filename
- Next by thread: Re: Stripping letters from filename
- Index(es):
Relevant Pages
|