|
-
Mar 4th, 2010, 02:30 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Comma filter
Hello!
Is there any solution to solve my problem?
I have string 12.3.2010,13.3.2010,14.3.2010,15.3.2010
And how to check for example: is 12.3.2010 member of this string up.
If it is, messagebox ("true")
If it isn't, messagebox ("false")
It's important to say that size of the string is not specified, so it can have more dates.
Thanks!!!
-
Mar 4th, 2010, 02:42 PM
#2
Hyperactive Member
Re: Comma filter
You can do this with the string.contains method. More info: http://msdn.microsoft.com/en-us/library/dy85x1sa.aspx
To deny our own impulses is to deny the very thing that makes us human
-
Mar 4th, 2010, 02:49 PM
#3
Thread Starter
Addicted Member
Re: Comma filter
Thank you for link, but problem is: my string are dates separate with commas (,)
So, how to check is for example 12.3.2010 member of this string:
11.3.2010,12.3.2010,13.3.2010
?
-
Mar 4th, 2010, 03:35 PM
#4
Hyperactive Member
Re: Comma filter
vb Code:
Dim str As String = "12.3.2010,13.3.2010,14.3.2010,15.3.2010" If str.Contains("12.3.2010") Then MsgBox("true") Else MsgBox("false") End If
-
Mar 4th, 2010, 04:54 PM
#5
Thread Starter
Addicted Member
Re: Comma filter
Yes! That's it.
I just replaced your constant with variable from textbox and it works perfectly. Thank you very much.
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
|