1. 首页
  2. 编程语言
  3. Java
  4. 找出子串位置.doc

找出子串位置.doc

上传者: 2020-08-20 02:24:23上传 DOC文件 26KB 热度 19次
package string_学习; public class test5 { public static int getoccur(String src, String find) { //getoccur("abchdjfhabcsdbakb", "abc") int cs = 0; int index = -1; while ((index = src.indexOf(find, index)) > -1) { ++index; ++cs; } return cs; } public static void getoccur1(Strin
下载地址
用户评论