string class : Contains(string) method

Description

It returns a boolean value that represents whether argument contains in the caller string.

Syntax

stringInstance.Contains(string searchString)

Arguments

ClassNameDescription
stringsearchStringA search string.

Return value

ClassDescription
boolA boolean value that represents whether argument contains in the caller string.

Sample code

1:

string str = "wwxxyyzz";

2:

bool containing = str.Contains("ww"); // The result (containing) is true.

Notes

This method is a member introduced from the Rice ver 1.0.1.1.

It's a wrapper of the System.String.Contains(String).

If an argument contains in the caller string, it returns true. Otherwise, it returns false.

If an argument is empty string, it returns true.

Links for reference

Copyright © Rice All rights reserved.