ソースコード
using System; using System.Linq; public static class StringExtensions { public static bool IncludeAny( this string self, params string[] list ) { return list.Any( c => self.Contains( c ) ); } }
使い方
var str = "ピカチュウカイリュー"; Debug.Log( str.IncludeAny( "ピカチュウ", "カイリュー" ) ); // True Debug.Log( str.IncludeAny( "カイリュー", "ヤドラン" ) ); // True Debug.Log( str.IncludeAny( "ヤドラン", "ピジョン" ) ); // False