String contains another two strings

前端 未结 17 1591
故里飘歌
故里飘歌 2020-12-15 07:12

Is it possible to have the contain function find if the string contains 2 words or more? This is what I\'m trying to do:

string d = \"You hit someone for 50          


        
17条回答
  •  忘掉有多难
    2020-12-15 07:39

    string d = "You hit someone for 50 damage";
    string a = "damage";
    string b = "someone";
    string c = "you";
    
    if(d.Contains(a) && d.Contains(b))
    {
        Console.WriteLine(" " + d);
    }
    Console.ReadLine();
    

提交回复
热议问题