tags:

views:

491

answers:

2

I wan't a method with which to find a string within another string. It should return the position of the first occurrence of the substring. (In VB 2008 !)

+6  A: 

String.IndexOf

Matthew Flaschen
sorry, no. IndexOf takes only ONE char but I want to search for a whole string like "anything" !
FunnyBoy
Sorry, no. IndexOf is overloaded, and I even linked to the right overload for you.
Matthew Flaschen
OK, I'm sorry -> I just discovered that it also takes whole strings. My fault !
FunnyBoy
No problem, Wuzzi.
Matthew Flaschen
A: 

I think you are looking for InStr function, see: InStr at msdn

Daniel Persson