xtd 0.2.0
Loading...
Searching...
No Matches
contains.cpp

Shows how to use xtd::string::contains method.

#include <xtd/console>
#include <xtd/string>
using namespace xtd;
auto main() -> int {
auto s = "This is a literal string";
console::write_line("The string: \""_s + s + "\""_s + (string {s}.contains("is") ? " contains " : " does not contain ") + "\"is\" substring."_s);
console::write_line("The string: \""_s + s + "\""_s + (string {s}.contains("z") ? " contains " : " does not contain ") + "\"z\" character."_s);
}
// This code produces the following output :
//
// The string: "This is a literal string" contains "is" substring.
// The string: "This is a literal string" does not contain "z" character.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10