Could we do something like this?
char word = "violet";
if ("vi" in word)
{
(do something);
}
Or is there any other way to do it?
Could we do something like this?
char word = "violet";
if ("vi" in word)
{
(do something);
}
Or is there any other way to do it?
Not quite, but you could write
if (strstr("violet", "vi")){
// do something
}