字符串包含问题
来源:互联网 发布:php开发短信平台 编辑:程序博客网 时间:2024/05/16 08:22
import java.io.*;import java.util.ArrayList;import java.util.List;import java.util.Scanner;/** * Created by ttc on 16-10-31. */public class 练习//{// public static void main(String[] args) throws IOException// {// File file=new File("d:/doubi/db.txt");// FileReader fr=new FileReader(file);// BufferedReader br=new BufferedReader(fr);// String str=null;//// int i =1;// while((str=br.readLine())!=null)// {// System.out.println(i+"."+str);// i++;// }//// }//}{ public static void main(String[] args) throws IOException { File file = new File("d:"); FileReader fr=new FileReader(file); BufferedReader br=new BufferedReader(fr); String str=null; List<String> li =new ArrayList<String>(); int i=1; while((str=br.readLine())!=null) { li.add(str); } System.out.println("请输入单词"); Scanner sc = new Scanner(System.in); String strword=sc.nextLine(); for(String strTemp:li) { boolean b=ContainsStr(strTemp,strword); if(b) { System.out.println(i+"."+strTemp); }i++; } } public static boolean ContainsStr(String st1,String st2) { if(st1.indexOf(st2)>=0) { return true; }else return true; }}
1 0
- 字符串包含问题
- 字符串移位包含问题
- 字符串的包含问题
- 字符串是否包含问题
- 字符串包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串移位包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串移位包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串是否包含问题
- 图解Git
- Android绘图初步—Path
- java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x10
- Android小項目之---時間線程應用(附源碼)
- 网游创业为什么会失败?
- 字符串包含问题
- HTML5 input file 打开很慢的问题
- yii2.0控制层操作分页增删
- CUDA 学习(二十)、优化策略5: 算法
- C++ 高质量编程附录试题
- spring boot @EnableAutoConfiguration 导致CNF问题
- mysql utf8mb4_unicode_ci utf8mb4_general_ci
- Java开发常见英文
- Servlet和JavaScript界面弹出提示框。