Shows how to use xtd::string::contains method.
#include <xtd/console>
#include <xtd/string>
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);
}
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
@ s
The S key.
Definition console_key.hpp:124
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8