public static void sop(Object e)
{
System.out.println(e);
}
}
/*
获取一个字符串在另一个字符串中出现的次数
*/
class Demo
{
public static void main(String[] args)
{
String s="asddefrddhrdd";
sop("<"+s+">");
sop("count="+sun(s,"dd"));
}
public static int sun(String str,String key)
{
int count=0;
int index=0;
while((index=str.indexOf(key))!=-1)
{
sop(str);
str=str.substring(index+key.length());
count++;
}
return count;
}
public static void sop(Object e)
{
System.out.println(e);
}
}
/*
获取两个字符串中的最大子串
*/
class Demo
{
public static void main(String[] args)
{