|
-
Jun 3rd, 2003, 10:17 AM
#1
Thread Starter
Lively Member
string split
I have a string in the following format
strData = "h:\Folder Name1\FolderName2 Comment About Something"
I would like to split the h:\Folder Name1\FolderName2" from the
"Comment About Something"
Len(strData) >=3
i would like to split strData into strPath and strComment
any help would be greatly appreciated
db
-
Jun 3rd, 2003, 10:18 AM
#2
Junior Member
Are there only two folders? If so, you could add another \ at the end of folder 2, and use that as a marker. Then, use the Split function, which I'm not very familiar with.
-
Jun 3rd, 2003, 10:22 AM
#3
Thread Starter
Lively Member
there number of folders is also variable
-
Jun 3rd, 2003, 10:24 AM
#4
Hyperactive Member
VB Code:
Dim Arr() As String
Arr = Split(strData, " ")
MsgBox Arr(0)
MsgBox Arr(1)
You can use this, if your folders will have "_" instead of space.
If you want to keep the space, there are other ways of doing that.
-
Jun 3rd, 2003, 12:26 PM
#5
Thread Starter
Lively Member
Unfortunately the folder names do contain spaces instead of the _ character.
Is there a way of splitting only at the first space after the text directly adjacent to the \
"\Text Split Before the S char"
Result:
"\Text"
"Split Before the S char"
thx
db
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|