读书人

串匹配:依据前缀和后缀确定目标子串

发布时间: 2012-11-15 15:16:14 作者: rapoo

串匹配:根据前缀和后缀确定目标子串

这样就行: 

String str = prefix + keyword + postfix; //如"prefix" + "Keyword" + "Postfix"return str.substring(prefix.length(), str.indexOf(postfix)); //"Keyword"

读书人网 >编程

热点推荐