Help - Search - Members - Calendar
Full Version: Alogorithms
CyberiaPC.com Community > Technical Zone > Programming (Java SE/EE, VB, C#)
Julie
:'( given 2 strings of characters, how can you test whether the first string appears as a substring somewhere in the second, what are you supposed to do here?
keno
You could use IndexOf

string1 = ob
string2 = bob

CODE
int ImFound = string2.IndexOf(string1);


ImFound would return -1 if it wasn't found, or the index value if it was
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.