有一个文本如下:
62218842300038296
43674201105281073
62836600128542
62270001104200505
......
43674201109294726如何在上面文本中查找出有没有 或有几个 重复出现的字符串呀??
在线等 多谢了!!
62218842300038296
43674201105281073
62836600128542
62270001104200505
......
43674201109294726如何在上面文本中查找出有没有 或有几个 重复出现的字符串呀??
在线等 多谢了!!
解决方案 »
- 如何在已经原有的图上再画图,并且都显示出来??????
- 请问:什么时候用单态类合适?
- 有关JAVA生成XML并通过流传输问题的困惑
- java.lang.ClassNotFoundException: oracle.jdbc.driver.oracledriver的问题
- 求java发送email的程序
- 这个作者有人清楚吗?rod。johnson,
- 放到button上的icon比button小怎么办?
- 我在用java调用一个存储过程时,oracle已经记录了一些数据。在v$sqlarea中,有sql_text,CPU_TIME ,ELAPSED_TIME 几个字段记录了值,有一些不明白的地方,
- 菜鸟入门 请教:入键盘接收字符串
- 关于double类型为null的问题。
- csdn 插入代码问题
- File类创建文件夹失败,但没有抛出异常
public static void main(String[] args) throws Exception {
File file = new File("D:/test.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(file)));
String str = null;
Map<String,Integer> map = new HashMap<String,Integer>();
while((str = reader.readLine())!=null){
map.put(str, map.get(str)==null?1:map.get(str)+1);
}
for(Entry<String, Integer> entry:map.entrySet()){
if(entry.getValue() > 1){
System.out.println(entry.getKey()+"重复次数:"+entry.getValue());
}
}
}
用了容器 程序没太看懂 好好读一下
不知道什么原因