String father="Welcome you to come here";String child ="you";1. 用到 String类的 indexOf() 方法 返回值!=-1 则包含 ,返回第一次出现的指定子字符串在此字符串中的索引。 2.使用String.matches方法判断是否包含子串,注意正则表达式元字符的转义 3.StringUtils.contains 判断是否包含某个字符 org.apache.commons.lang.StringUtils 包 4..String类提供的方法 public boolean contains(CharSequence s) 参考: [1].