Newbie: Is there simple way to find a string in a long string?

  • Thread starter Thread starter Galaxia
  • Start date Start date
G

Galaxia

Hi,

Is there any simple method to search a short string in a long string?
I want to test whether the short string is contained in the long string, just like something as CString.Find(...) in MFC. Is there similar thing in .Net Framework? I failed to find it.

--
"Forward Galaxia"
 
Galaxia said:
Hi,

Is there any simple method to search a short string in a long string?
I want to test whether the short string is contained in the long string,
just like something as CString.Find(...) in MFC. Is there similar thing
in .Net Framework? I failed to find it.

String.IndexOf();

if (stringVar.IndexOf("StringToSearchFor") > -1)
...
 
Back
Top