is instr used in vb.net for this?
-1 for the "no" because Instr **is** available and used in VB.Net, so the answer is wrong as it stands.
MarkJ
2009-10-29 12:30:24
@MarkJ, problem with instr, it doesn't know when it's an empty string and when the position is found at index 0, both return 0 and you need to handle null.
Fredou
2009-10-29 13:23:21
+3
A:
Use String.IndexOf
http://msdn.microsoft.com/en-us/library/system.string.indexof.aspx
AcousticBoom
2009-10-28 19:04:19
+1
A:
You can use the IndexOf method on a string, and you can also use the VB InStr function if you wish, although I would suggest sticking to .NET specific functions.
I would also suggest that you take a look at the documentation of the String methods which will help you know what functionality is available in the framework when working with strings. You can also take a look at the documentation for VB-specific string functions.
Meta-Knight
2009-10-28 19:13:28
The pros and cons of the VB-specific functions like Instr are discussed in other questions. http://stackoverflow.com/questions/tagged/microsoft.visualbasic
MarkJ
2009-10-29 12:34:19