C
Cliff
Hello
I'm trying to search for each instance of a string (using wildcards) in another string. I know there is the Like operator, but it seems to be work with booleans and I want to define a string variable.
I tried strPdfFileName = strPdfFileName Like "########.pdf"
I'm sure there's a better string methd to better accomplish what I'm doing here.
Thans in advance - Cliff
Function ExtractPdfFileNames(ByVal strSourceText As String) As ArrayList
Dim arrFoundPdfFileNames As New ArrayList()
Dim strPdfFileName As String
'define what a pdf filename looks like
strPdfFileName = 'here is where I want to define ".pdf" and 8 digits to the left (i.e. "13567849.pdf") _
or even any word ending in ".pdf"
'copy pdf filenames from source text into arraylist
For Each strPdfFileName In strSourceText
arrFoundPdfFileNames.Add(strPdfFileName)
Next
'return the results
Return arrFoundPdfFileNames
End Function
I'm trying to search for each instance of a string (using wildcards) in another string. I know there is the Like operator, but it seems to be work with booleans and I want to define a string variable.
I tried strPdfFileName = strPdfFileName Like "########.pdf"
I'm sure there's a better string methd to better accomplish what I'm doing here.
Thans in advance - Cliff
Function ExtractPdfFileNames(ByVal strSourceText As String) As ArrayList
Dim arrFoundPdfFileNames As New ArrayList()
Dim strPdfFileName As String
'define what a pdf filename looks like
strPdfFileName = 'here is where I want to define ".pdf" and 8 digits to the left (i.e. "13567849.pdf") _
or even any word ending in ".pdf"
'copy pdf filenames from source text into arraylist
For Each strPdfFileName In strSourceText
arrFoundPdfFileNames.Add(strPdfFileName)
Next
'return the results
Return arrFoundPdfFileNames
End Function