|
-
Jul 7th, 2004, 12:28 PM
#1
Thread Starter
Member
Need help with string manipulation
Hello All,
Is there a way to search a string for pattern like hh:mm:ss AM or PM and then extract it if it exists.
Tahnk you.
-
Jul 7th, 2004, 01:04 PM
#2
Member
I would start with finding the beginning of what you are looking for;
dim index as integer
index = string.LastIndexOf(searchstring)
Then copy what you want into another string;
newstring = searchstring.substring(index, len(searchstring))
This would do it, but it's very general, just read the string manipulation help files, then go through the string you're searching bit by bit and copy what you need.
-
Jul 7th, 2004, 02:06 PM
#3
Fanatic Member
Read up on regular expressions (System.Text.RegularExpressions).
-
Jul 8th, 2004, 10:15 AM
#4
Thread Starter
Member
I’m trying to math this pattern 12:00:00 AM
Code:
“\A(\d(1[0-2][0-9])): (\d(2[0-5][0-9])): (\d(3[0-5][0-9]))\s AM|PM \Z”
Can some one tell me what I’m doing wrong
-
Jul 8th, 2004, 10:56 AM
#5
Lively Member
Check out the Like function. Great for pattern matching too.
HTH
Hume
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
|