C#

문자열 검색 " String.Contains() "

by kay posted Sep 04, 2013
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

문자열 검색 샘플입니다.


msdn Url : http://msdn.microsoft.com/ko-kr/library/dy85x1sa.aspx


// This example demonstrates the String.Contains() method
using System;

class Sample 
{
    public static void Main() 
    {
    string s1 = "The quick brown fox jumps over the lazy dog";
    string s2 = "fox";
    bool b;
    b = s1.Contains(s2);
    Console.WriteLine("Is the string, s2, in the string, s1?: {0}", b);
    }
}
/*
This example produces the following results:

Is the string, s2, in the string, s1?: True
*/